Skip to main content

Audit

The ledger: provenance per agent, full-chain verification, raw export for offline verification.

MethodPathScopeSummary
GET/audit/{agent_id}readGet Behavioral Provenance
GET/audit/{agent_id}/verifyreadVerify Ledger
GET/audit/exportreadExport Ledger

Try it

curl -sf -X POST "$VIGIL_URL/agents/" -H "Authorization: Bearer $VIGIL_KEY" -H "Content-Type: application/json" \
-d '{"agent_id":"docs-api","name":"Docs API"}' > /dev/null || true
curl -sf -X POST "$VIGIL_URL/events/" -H "Authorization: Bearer $VIGIL_KEY" -H "Content-Type: application/json" \
-d '{"agent_id":"docs-api","event_type":"output_generated","payload":{"content_length":512},"dti":0.9}' > /dev/null
curl -sf -H "Authorization: Bearer $VIGIL_KEY" "$VIGIL_URL/audit/docs-api/verify"

Routes

GET /audit/{agent_id}

Get Behavioral Provenance. Scope: read.

Returns the behavioral provenance log for an agent: every decision, its context, and the enforcement outcome. Write-once records.

ParameterInRequiredTypeNotes
agent_idpathyesstring
limitquerynointeger

Response 200:

[
{
"event_id": 0,
"agent_id": "string",
"event_type": "string",
"monitored_at_time": true,
"recorded_at": "string",
"gate_status": "string | null",
"bii_at_trigger": 0,
"requires_human_review": true,
"seq": 0,
"chain_hash": "string | null",
"policy_digest": "string | null"
}
]

GET /audit/{agent_id}/verify

Verify Ledger. Scope: read.

Recompute the org's whole chain (one agent's records cannot be verified in isolation) and check every HMAC with the server secret.

ParameterInRequiredTypeNotes
agent_idpathyesstring

Response 200:

{
"ok": true,
"length": 0,
"head": "string",
"first_bad_seq": 0,
"agent_records": 0
}

GET /audit/export

Export Ledger. Scope: read.

Raw ledger rows for this org in seq order. Feed to tools/vigil_verify.py to verify offline. The plan's retention_days bounds the window for ordinary keys; a platform key reads every row. Nothing is ever deleted (decision rule 17).

ParameterInRequiredTypeNotes
since_seqquerynointeger
limitquerynointeger

Response 200:

[
{
"seq": 0,
"agent_id": "string",
"event_id": 0,
"record_type": "string",
"content": "string",
"content_hash": "string",
"prev_hash": "string",
"chain_hash": "string",
"hmac": "string",
"policy_digest": "string",
"recorded_at": "string"
}
]

Generated from openapi.json (VIGIL 0.2.0). Scopes follow the router dependencies in VIGIL_SPEC.md section 4.2.