Get release news

Verify an AI agent's audit log: signed and chained

An audit trail is only evidence if a change to it would show. With an identity, each line is signed with the agent's own key and chained to the one before, and constle audit verify names the line where an edit, a reordering, or a deletion with a line after it breaks the chain.

On this page

Note

Release status

The current source and its signed releases aren't public yet. More in Project status.

What you'll getLink to this section

  • A JSONL audit log per agent per UTC day, written by the host, with the allows and refusals the proxy and gates see, tool calls, approvals and limits in it.
  • With an identity, each line is signed with the agent's own key (Ed25519) and chained to the one before by its SHA-256 hash, and the chain is checked offline.
  • A verification that is pinned to the agent identity and approver key you expect, not just to whatever key the file carries.

Why sign and chainLink to this section

A log the agent could write to is not evidence about the agent, and a log anyone with file access could edit quietly is not much evidence either. Constle writes the log from the host process, outside the sandbox. With identity.did set, each entry is signed with the agent's key and carries the hash of the line before it, so the file is checked as a sequence. Change one byte and that line's signature fails. Remove a line and the next one points at a hash that no longer exists. Format details: Audit log and verification.

1. Declare an identityLink to this section

shell
constle identity create basic-agent --owner=you@example.com

Paste the printed DID under identity.did. Without it, the log is still written, but unsigned. With it, constle run refuses to start if the key is missing, so a run cannot silently fall back to an unsigned log. More in Give each AI agent a verifiable identity.

2. Run the agent and find the logLink to this section

shell
constle run agent.yaml
ls ~/.constle/logs/

Each agent writes one log file per UTC day: ~/.constle/logs/<name>-<date>.jsonl, named after identity.name. A new run appends to the day's file, and its first entry chains to the last line already there.

3. Read the events that matterLink to this section

Each line is one JSON object with timestamp, run_id, agent_name, event and details, plus did, prev_hash and sig when signed. run_started also carries isolation_level. A few questions and the lines that answer them:

shell
LOG=~/.constle/logs/basic-agent-$(date -u +%F).jsonl
grep network_blocked "$LOG"          # where did it ask the proxy to go that it wasn't allowed?
grep -E 'tool_call_start|mcp_tool_blocked' "$LOG"   # which tools did it call, or try to?
grep -E 'gate_(triggered|approved|denied|timeout)' "$LOG"   # what waited for a person, and what was decided?
grep -E 'spending_limit_reached|terminated_by_limit' "$LOG"   # did a cap or the time limit stop it?
Event Means
run_started, run_finished A run began and ended. run_started records the requested and achieved isolation and the credential names granted.
network_allowed, network_blocked The proxy allowed or refused a request. These are written when the run ends, and the run's last moments can be missing.
tool_call_start, tool_call_end An MCP tool call was forwarded: the server, the tool and the argument size, never the arguments.
mcp_tool_blocked, mcp_request_blocked The MCP gate refused a call or a request.
gate_triggered … gate_timeout A human gate held one of the calls that pass through the gate, and this is how it resolved.
spending_limit_reached, terminated_by_limit A spend cap on calls that pass through the gate, or the time limit, stopped the run. A spending_limit_reached with severity: warning is the daily alert threshold instead, which stops nothing.

The full list: Audit log.

4. Verify, pinnedLink to this section

shell
constle audit verify --agentfile=agent.yaml ~/.constle/logs/basic-agent-$(date -u +%F).jsonl
Output
✓ audit log verified: /home/you/.constle/logs/basic-agent-<date>.jsonl

  entries:   2 (all signatures valid, hash chain intact)
  signed by: did:key:z6MkgroKowQYDZjDmqbn82mJv4YFPKowS2xDhxGYrp4u3P1o
  pinned:    DID matches the expected identity
  pins from: agent.yaml (identity.did only — it declares no approver_pubkey, so gate decisions are unpinned)

--agentfile takes both trust anchors from the Agentfile: the agent's identity.did and the human_gates.approver_pubkey that recorded approvals must verify against. --did= and --approver-pubkey= pin them one at a time. The check works offline: the key is recovered from the DID string itself.

5. See what tampering looks likeLink to this section

Edit one byte of the file and verify again:

Output
error: TAMPERING DETECTED in /home/you/.constle/logs/basic-agent-<date>.jsonl
  line 1: invalid_signature — signature does not verify against did:key:z6MkgroKowQYDZjDmqbn82mJv4YFPKowS2xDhxGYrp4u3P1o — the entry was edited after signing
Change Reported as
A line edited invalid_signature, at that line.
A line deleted, with another after it chain_break_missing_entry, at that position.
Lines reordered chain_break_reordered, at that position.
The whole log re-signed with another key did_mismatch, when the DID is pinned.

6. Keep a copy somewhere elseLink to this section

The log alone cannot show that lines were cut from its end: a shorter chain is still an intact chain. Nor can it show that the file is the current one: an older copy, or another log signed by the same key, verifies too. If that matters to you, copy each day's log, or at least its last line or its hash, to storage the host cannot rewrite, and compare later. This is a practice, not a Constle feature.

What an intact chain proves, and what it doesn'tLink to this section

A signed log shows each entry is unchanged, not that the log is complete.

Proves Does not prove
No signed entry was changed, inserted or reordered since it was signed. That the account is true: the host wrote it, and the host is trusted.
The lines present are signed and in order, with none missing between them. That none were cut from the end, or that the run's last moments are in it: network events and gate events from calls still in progress when a run ends can be missing, even on success.
With the DID pinned, the lines were signed by the identity you expect. That the file wasn't replaced whole by an older copy, or by another log signed with the same key.
A recorded webhook approval was signed by the pinned approver key over that call's digest. Which arguments a signed digest was for: for each gated call, the log keeps an unsalted SHA-256 of the tool name and arguments, not the arguments, and guessable arguments can be recovered from it.
That every MCP call went through the gate: traffic to hosts you allow isn't gated, and if an allowed host shares a server with an MCP server, a request can reach that MCP server past the gate, leaving no tool or gate event.

Unpinned, verification only shows the log agrees with its own key, and says so.

FAQLink to this section

Can the agent edit or delete its own audit log?Link to this section

The log is written by the host constle process to the invoking user's home directory, outside the sandbox. On Docker, none of your files are mounted into the sandbox, so the agent has no path to the file while the sandbox holds, which on Docker means while your shared kernel holds. Someone with access to the host can change the file. Verification then reports the line where the chain breaks, except for lines cut from the end or a whole log swapped for another signed with the same key (step 6).

Does verification need a network connection?Link to this section

No. constle audit verify recovers each key from the DID string itself, so it works offline, with no registry or resolution service.

Are tool arguments or secrets written to the log?Link to this section

Not the arguments themselves. Tool calls are recorded by server, tool name and argument size, and credentials by name only, never by value. For each gated call, the log keeps an unsalted SHA-256 of the tool name and arguments (subject_digest), not the arguments. Guessable arguments can be recovered from it.

Is this enough for compliance logging requirements?Link to this section

With an identity, it gives you an automatically written, signed and chained record of what the runtime allowed and refused, which you can verify yourself. Whether that meets a particular regulation depends on the regulation and your system. Ask whoever is responsible for that assessment.