Audit
The ledger: provenance per agent, full-chain verification, raw export for offline verification.
| Method | Path | Scope | Summary |
|---|---|---|---|
GET | /audit/{agent_id} | read | Get Behavioral Provenance |
GET | /audit/{agent_id}/verify | read | Verify Ledger |
GET | /audit/export | read | Export 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.
| Parameter | In | Required | Type | Notes |
|---|---|---|---|---|
agent_id | path | yes | string | |
limit | query | no | integer |
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.
| Parameter | In | Required | Type | Notes |
|---|---|---|---|---|
agent_id | path | yes | string |
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).
| Parameter | In | Required | Type | Notes |
|---|---|---|---|---|
since_seq | query | no | integer | |
limit | query | no | integer |
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.