CAIN-42 CAIN Studio

CAIN-42 · See what your agents do

CAIN Trace

A tamper-evident record of every step an agent took, in order.

Last reviewed 2026-10-01

Live   Core platform · infrastructure

What it is

Immutable execution trace and audit trail.

Where it fits

Part of See what your agents do: Every action, every decision, replayed and searchable. Every CAIN-42 product runs behind the same rule: an AI agent's action is checked before it runs (identity, authority, policy, risk), decided as allow, hold for a human, or block, and recorded as signed evidence. Unknown or error never becomes allow.

Use it

Recorded status: PRODUCTION. "Live" on this page means its link answered when the catalog was last checked (2026-10-01T18:22 UTC).

Live now

Checked from your browser when this page opened, not from a cached list.

Fire a real decision

Send an action through the live CAIN-42 pipeline from this page, with no account, and watch every stage decide. This is the same pipeline every product here sits behind; it runs for a throwaway demo tenant and is rate limited.

For AI engineers

Every product sits behind one decision path: your agent proposes an action with the exact arguments, CAIN runs it through identity, authority, policy, risk, trust and quorum consensus, and answers ALLOW, REQUIRE_APPROVAL or DENY with an Ed25519-signed record. A timeout, outage or unknown verdict never becomes ALLOW. A brand-new agent has no trust history, so its first actions usually come back REQUIRE_APPROVAL.

Python (zero dependencies)

pip install https://cainstudio.online/cainstudio-0.3.0-py3-none-any.whl
export CAIN_API_KEY=...   # free key: https://cainstudio.online/signup

import cainstudio

@cainstudio.guard()
def transfer(amount_usd: float, to: str) -> str:
    ...  # runs only if CAIN allows this call, with these arguments

try:
    transfer(5000, "acme")
except cainstudio.ApprovalRequired as e:
    print("held for a human:", e.approval_id)
except cainstudio.ActionBlocked as e:
    print("refused:", e.decision.reasons)
except cainstudio.CainUnavailable:
    print("CAIN unreachable: not run")   # fail-closed

See a real decision with no account

cainstudio try          # live pipeline, stage by stage
cainstudio try --list   # the other attack scenarios

MCP clients (Claude Code, Cursor)

claude mcp add --transport http cain https://cainstudio.online/mcp

More: Python SDK · TypeScript SDK · framework integrations · AI quickstart · decision signing key

Tested guarantees in this area

Every rule in these niches has its own page with its recorded result.

Related

Full documentation

The complete reference, also at /docs/trace.

CAIN Trace Documentation#

Status: LIVE + FUNCTIONAL#

Verified 2026-09-08: /fabric/traces/ returns [] (empty - no traces created yet, but endpoint exists and is tenant-scoped).

CAIN Trace is fully functional. The core trace engine, API, dashboard, and correlation with CAIN decisions are implemented and working.


What is CAIN Trace?#

CAIN Trace records the complete execution lifecycle of every CAIN-protected action. It provides immutable, tenant-isolated execution history that correlates identity, decisions, enforcement, and evidence.

Core principle: Every CAIN decision creates a trace automatically. No manual trace creation required for normal operation.


Trace Lifecycle#

A trace progresses through these stages:

1. TRACE CREATED - Action received, trace initialized 2. IDENTITY RESOLVED - Principal authenticated (if identity_id provided) 3. POLICY EVALUATED - OPA policy checked 4. AUTHORIZATION EVALUATED - Agent permissions verified 5. RISK EVALUATED - Risk score calculated 6. TRAJECTORY EVALUATED - Trajectory safety checked (if applicable) 7. CAIN DECISION - Final verdict determined 8. ENFORCEMENT APPLIED - ALLOW or DENY enforced 9. EXECUTION - Tool/MCP call made (ALLOW only) 10. EVIDENCE CREATED - Immutable record stored 11. TRACE CLOSED - Final state recorded


Data Model#

ExecutionTrace#

FieldTypeDescription
trace_idstringUnique trace identifier (trc_xxxx)
tenant_idstringTenant namespace
agent_idstringAgent that executed
identity_idstringIdentity of caller
actionstringAction performed
toolstringTool used
resourcestringResource accessed
decision_idstringCAIN decision ID
trajectory_idstringTrajectory ID (if applicable)
evidence_idstringEvidence record ID
verdictenumALLOW, DENY, REQUIRE_APPROVAL, UNKNOWN, ERROR
statusenumPENDING, COMPLETED, DENIED, FAILED, ERROR
execution_outcomestringWhat happened
timestamp_startdatetimeWhen trace started
timestamp_enddatetimeWhen trace ended
duration_msfloatExecution duration

TraceEvent#

FieldTypeDescription
event_idstringUnique event ID
trace_idstringParent trace
event_typestringType of event
stagestringLifecycle stage
verdictstringStage verdict
detaildictEvent data
timestampdatetimeWhen event occurred

API Endpoints#

Health Check#

GET /fabric/traces/health

Returns trace service health status.

Create Trace (Internal)#

Traces are created automatically by make_cain_decision(). Manual creation via:

POST /fabric/traces/?action=<action>&tool=<tool>

List Traces#

GET /fabric/traces/

Query parameters:

Get Trace#

GET /fabric/traces/{trace_id}

Returns full trace with events and integrity verification.

Get Trace Events#

GET /fabric/traces/{trace_id}/events

Returns ordered list of lifecycle events.

Get Trace Evidence#

GET /fabric/traces/{trace_id}/evidence

Returns evidence records with integrity verification.

Search Traces#

POST /fabric/traces/search

Advanced search with multiple filters.

Stats Summary#

GET /fabric/traces/stats/summary

Returns aggregate statistics.


Authentication#

All trace endpoints require:

Note: Traces are automatically created when make_cain_decision() is called. The tenant is derived from the API key.


Tenant Isolation#


Correlation#

Decision Correlation#

Every trace links to its CAIN decision via decision_id.

Evidence Correlation#

ALLOW decisions create evidence linked via evidence_id.

Trajectory Correlation#

When identity_id is provided, traces link to trajectories via trajectory_id.


Dashboard#

Access the trace dashboard at:

https://cainstudio.online/trace
https://cainstudio.online/trace/dashboard

The dashboard displays real traces from the backend with filtering and search capabilities.


CLI#

Trace commands are available via the CAIN CLI:

cain trace list
cain trace get <trace_id>
cain trace events <trace_id>

Trace States#

StatusMeaning
PENDINGTrace created, decision pending
COMPLETEDAction allowed and executed
DENIEDAction blocked by CAIN
FAILEDExecution failed
ERRORSystem error (fail-closed)

Verdict Definitions#

VerdictMeaningExecution
ALLOWAction permittedYes
DENYAction blockedNo
REQUIRE_APPROVALHuman approval neededNo
UNKNOWNCannot determineNo (fail-closed)
ERRORSystem failureNo (fail-closed)

Real Examples#

ALLOW Trace#

{
  "trace_id": "trc_abc123",
  "tenant_id": "tenant-xyz",
  "action": "deploy_service",
  "tool": "kubectl",
  "verdict": "allow",
  "status": "completed",
  "decision_id": "cain:def456",
  "evidence_id": "ev_789",
  "execution_outcome": "Service deployed successfully"
}

DENY Trace#

{
  "trace_id": "trc_xyz789",
  "tenant_id": "tenant-xyz",
  "action": "delete_all_data",
  "tool": "database",
  "verdict": "deny",
  "status": "denied",
  "decision_id": "cain:ghi101",
  "execution_outcome": "Tool 'delete_all_data' is not registered for this agent"
}

Security Considerations#


Limitations#

Try CAIN-42 on your own agents

Create a free account and every new account starts with a 7-day trial of the full platform. Or try the sandbox first, with no account at all.

Create a free account →  ·  Try the sandbox  ·  See the whole ecosystem