Skip to content

docs(drafts): scheduled-run audit records, retention, and the logger sink - #3021

Open
jhrozek wants to merge 4 commits into
mainfrom
docs/scheduled-run-audit
Open

jhrozek wants to merge 4 commits into
mainfrom
docs/scheduled-run-audit

Conversation

@jhrozek

@jhrozek jhrozek commented Nov 28, 2026 •

Copy link
Copy Markdown
Contributor

Scheduled-run audit: design edits

Design-only change to docs/drafts/agent-identity/. It makes the audit design say what scheduled runs need from the trail, and corrects two statements about the toolhive-core logger.

  • Reference: a scheduled run's records point to the schedule's current grant record (its latest setup or renewal). AS-1's 30-day horizon cap bounds the reference.
  • Session open: the broker records the consent facts the run relies on, including the AuditID of the current grant record.
  • End of authority: the broker records each scheduled-run end with its reason (signed_out, upstream_revoked, owner_action_required, horizon_reached, revoked, deleted). AS-1 records its schedule-grant revocations.
  • Retention: each record is kept for the deployment's retention period from its own LoggedAt. Schedule grant records (setup and renewal) are kept that long plus AS-1's horizon cap. The store enforces retention; Mecatl runs no timers. Transcript retention is left to the open decision in the transcript issue.
  • Logger: toolhive-core's logger takes an io.Writer and has no HTTP sink. HTTP delivery needs an adapter.
  • Operation IDs: the vMCP verifies the operation ID in the token's call entry, which AS-1 and AS-2 signed. The copy a client sends in _meta stays reported. Until #6979 lands, a mecatl subject enricher (Name the gateway token and its operation on the embedded gateway's audit events #3023) is an interim stopgap for the token jti and entry operation ID.
  • AS-2 redemption: records the jti of the access token it issues, linking the redemption to the vMCP's record of the call.
  • Reconciliation: each check names the fields it compares, using logical names. Two checks wait on later work: the AS-2 access-token jti (#7375, which waits on #3919) and the vMCP's verified operation ID (the Name the gateway token and its operation on the embedded gateway's audit events #3023 stopgap, then #6979).

Open scope proposal (for discussion; not applied)

Move AS-1's schedule-grant events (issuance at setup with its horizon, the child-grant exchange at each run open with the upstream re-check result, and each ID-JAG issuance with its source grant) from phase 3 into phase 2. This would change:

The authorization-server events need toolhive#3919 for at least these events before the end-to-end scenario (#2817) closes.

Tracker fixes to make (not applied in this PR)

Not in this PR

  • No issue edits.
  • The ToolHive-facing #3919 comment is drafted separately; it does not link the private repository.

jhrozek and others added 3 commits November 28, 2026 21:20
…sink

Scheduled-run records reference the schedule's current grant record, not
the original setup. Each scheduled-run session open records the consent
facts it relies on, and each scheduled-run end records its reason.

Retention is counted from each record's own LoggedAt; schedule grant
records (setup and renewal) get the deployment period plus AS-1's horizon
cap. Transcript retention is left open for the transcript decision.

Correct the logger: toolhive-core's audit logger takes an io.Writer and has
no HTTP sink, so HTTP delivery needs an adapter.

Co-Authored-By: mecatl <[email protected]>
The vMCP verifies the operation ID in the token's call entry, which AS-1
and AS-2 signed. The copy a client sends in _meta stays reported. Mark the
verified value as such in the audit profile and the ledger.

Name the interim mecatl subject enricher (#3023) as a stopgap for the token
jti and entry operation ID, to be removed once #6979 lands.

AS-2 redemption records the jti of the access token it issues, which links
the redemption to the vMCP's record of the call.

Co-Authored-By: mecatl <[email protected]>
Each reconciliation row now names the record fields it compares, using
logical names rather than storage keys, since #3023 and #6979 store the
same values in different places. Two checks wait on later work: the AS-2
access-token jti (#7375, which waits on #3919) and the vMCP's verified
operation ID (the #3023 stopgap, then #6979). The ledger gains a row for
#7375.

Co-Authored-By: mecatl <[email protected]>
…ords

Under lossless delivery: a local file destination must rotate without losing
or splitting a record, and a failed rotation makes the sink refuse the next
record. Rotation flags and operator docs belong with the implementation.

Co-Authored-By: mecatl <[email protected]>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant