AI assistants can sort your inbox, but nothing makes them pay for bad judgment.
This repo proves a narrow alternative: inbox triage decisions can be made under bond, with human correction determining whether the agent's judgment was right.
agent-007-bonded-email-triage is a local CLI proof of concept. It reads one email from a text file, asks Claude to classify it into exactly one of four categories, locks a small bond through AgentGate, records the bonded triage action, and then lets a human either confirm the classification or override it. Exact agreement releases the bond. Any different category slashes it.
- Reads one email at a time from a local text file
- Classifies into exactly one of
ignore,reply,task, orhuman - Returns a category, numeric confidence, and short explanation
- Loads or creates a local Ed25519 identity and registers it with AgentGate
- Locks a small bond and executes a bonded action with
actionType: "email-triage" - Prompts a human for exact confirmation or one-category override
- Resolves success on exact agreement and failed on any mismatch
- Persists a tiny local scorecard with totals, matches, mismatches, and per-category counts
- Gmail integration
- Sending or drafting
- Calendar work
- Background processing
- Web UI
- MCP server
- Autonomous escalation tiers
- Partial credit, nuanced grading, or policy learning
- Broad inbox assistant behavior
-
Install dependencies:
npm install
-
Copy the example env file and fill in your secrets:
cp .env.example .env
-
Run the CLI against a local email file:
npm run triage -- ./examples/sample-1-reply.txt
Required:
ANTHROPIC_API_KEYAGENTGATE_BASE_URLAGENTGATE_API_KEY
Useful defaults are included in .env.example.
The local scorecard is intentionally tiny and separate from AgentGate reputation. By default it writes to .local/scorecard.json and tracks:
totalJudgmentsexactMatchesmismatchesperCategory
The per-category counts use the final human category, not the agent's guess.
This repo keeps the AgentGate client explicit and configurable. The public AgentGate docs describe the gateway and approval queue, but do not publish bonded judgment endpoints. For that reason, this project ships with a small REST client that assumes the following default paths and lets you override every one of them via environment variables:
/api/bonded/identities/api/bonded/bonds/lock/api/bonded/actions/api/bonded/actions/{actionId}/resolve
Requests are signed with a local Ed25519 key pair and include signature headers on bonded requests. The identity is also persisted locally so repeated runs reuse the same key.
- Read
./examples/sample-2-task.txt - Ask Claude for a single triage category
- Register or load the local agent identity with AgentGate
- Lock a small bond
- Create a bonded
email-triageaction - Show the email, prediction, and explanation to a human
- Human enters
corrector one of the four categories - Resolve success or failed based on exact category agreement
- Update the local scorecard
- The human is the ground truth. There is no partial credit.
- The classifier only sees raw email text from one file at a time.
- The scorecard is local bookkeeping, not portable reputation.
- The default AgentGate bonded endpoints are assumptions, not public standard paths.
- This repo proves bonded triage judgment, not a full inbox assistant.
The test suite covers:
- One happy-path exact-match bonded judgment
- One mismatch that resolves
failedandslash - Scorecard persistence
- Classifier response parsing