Skip to content

Accept and record which agent acted - #11

Merged
JulioMCruz merged 1 commit into
mainfrom
feat/agent-claim-attribution
Aug 23, 2026
Merged

Accept and record which agent acted#11
JulioMCruz merged 1 commit into
mainfrom
feat/agent-claim-attribution

Conversation

@JulioMCruz

Copy link
Copy Markdown
Contributor

Why

wallet identifies the board, not the caller. For an invited agent it is the human owner's wallet, so every agent action in audit_log was indistinguishable from the owner's own — and a leaked agent credential left no trace of which agent it impersonated.

Pairs with PerkOS-API #176, which stamps the claim on mint.

What

  • verifyToken accepts an optional agent claim and returns it. Typed: a non-string agent is rejected rather than silently dropped, so a malformed token cannot smuggle a non-string through into the audit record.
  • Tokens minted before the claim existed keep verifying — the checks are by type and the claim is optional. Covered by test.
  • The audit record carries agent (null when absent), so tool calls become attributable to the credential that made them.

Verification

  • npm run typecheck clean
  • npm test: 51 passed
  • New tests/agentClaim.test.ts covers round-trip, the pre-claim token, and the malformed-claim rejection

Note: npm run lint fails in this repo on an ESLint config migration (.eslintrc.* → flat config). Pre-existing and unrelated to this change.

`wallet` identifies the BOARD, not the caller. For an invited agent it is the
human owner's wallet, so every agent action in the audit log was
indistinguishable from the owner's own, and a leaked agent credential left no
trace of which agent it impersonated.

- verifyToken accepts an optional `agent` claim and returns it. Typed, so a
  non-string is rejected rather than silently dropped.
- Tokens minted before the claim existed keep verifying: the checks are by
  type and the claim is optional. Covered by test.
- The audit record carries `agent` (null when absent), so tool calls are
  attributable to the credential that made them.

Pairs with PerkOS-API #176, which stamps the claim.
@JulioMCruz
JulioMCruz merged commit c697fc9 into main Aug 23, 2026
2 checks passed
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