# agent-custody

Checks agent tool calls against signed grants and policy, then issues signed receipts. Use it when actions need an offline-verifiable audit trail.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI · ★ 8
- Author: svayatta
- License: Apache-2.0 · policy=link-only · description only; the file stays with the author
- Source: https://github.com/svayatta/agent-custody/tree/HEAD/packages/receipts
- Updated: 2026-10-23
- HTML: https://affpapa.org/en/nevibecode/mcp/agent-custody

## What it does

agent-custody can sit between an agent and the systems it may affect, including MCP servers, REST APIs exposed as tools, and agents reached through A2A. For every allowed or denied call, the gateway checks a signed delegation grant, requests human approval for exact arguments when required, evaluates a Cedar policy, and forwards the call only after an allow decision. It then appends a signed receipt to a Merkle transparency log.

The package also includes an SDK interceptor for calls made inside the agent process. It has Claude Code hooks and adapters for several agent SDKs, while marking those receipts as self-reported. Anyone with the public keys can verify a receipt offline; selected call fields can be withheld as commitments or encrypted with a chosen key.

The SDK package requires Node 22 or later and `@agent-custody/receipts`. Create a signing key with `npx agent-custody keygen`. Node 22 or later is required for the published package.

## Requirements
- Needs: Node.js (commands run via npx)

## Install

### Claude Code (native platform)

**Platform CLI**
```bash
claude mcp add receipts -- npx -y @agent-custody/receipts
```

### Codex

**Platform CLI**
```bash
codex mcp add receipts -- npx -y @agent-custody/receipts
```

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "receipts": {
            "command": "npx",
            "args": [
                "-y",
                "@agent-custody/receipts"
            ]
        }
    }
}
```

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "receipts": {
            "type": "stdio",
            "command": "npx",
            "args": [
                "-y",
                "@agent-custody/receipts"
            ]
        }
    }
}
```

### Gemini CLI

**Platform CLI**
```bash
gemini mcp add receipts npx -y @agent-custody/receipts
```

## When to use it
- check each tool call against a signed delegation grant
- append allowed and denied actions to a Merkle log
- verify receipts offline with public keys
- enforce Cedar policy before forwarding a call
- withhold or encrypt selected call fields

## Example prompts
- Use `receipts` to inspect this tool call and issue a signed receipt.
- Show me how to verify the agent’s recorded actions offline with a public key.
- Route this delegated action through the Cedar policy and allow it only after the grant check passes.

## Similar
- [protect-mcp](https://affpapa.org/en/nevibecode/plugins/protect-mcp.md) — plugin · ★ 41823
- [review-agent-governance](https://affpapa.org/en/nevibecode/plugins/review-agent-governance.md) — plugin · ★ 41823
- [HOL Guard](https://affpapa.org/en/nevibecode/mcp/hol-guard.md) — MCP server · ★ 1000
- [agents-connect](https://affpapa.org/en/nevibecode/skills/agents-connect.md) — skill · 2000 installs
- [agent-owasp-compliance](https://affpapa.org/en/nevibecode/skills/agent-owasp-compliance.md) — skill · 1500 installs
- [Trustabl](https://affpapa.org/en/nevibecode/mcp/trustabl.md) — MCP server · ★ 79

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
