Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

agent-007-bonded-email-triage

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.

What v0.1 does

  • Reads one email at a time from a local text file
  • Classifies into exactly one of ignore, reply, task, or human
  • 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

What v0.1 does not do

  • 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

Quick start

  1. Install dependencies:

    npm install
  2. Copy the example env file and fill in your secrets:

    cp .env.example .env
  3. Run the CLI against a local email file:

    npm run triage -- ./examples/sample-1-reply.txt

Environment

Required:

  • ANTHROPIC_API_KEY
  • AGENTGATE_BASE_URL
  • AGENTGATE_API_KEY

Useful defaults are included in .env.example.

Local scorecard

The local scorecard is intentionally tiny and separate from AgentGate reputation. By default it writes to .local/scorecard.json and tracks:

  • totalJudgments
  • exactMatches
  • mismatches
  • perCategory

The per-category counts use the final human category, not the agent's guess.

AgentGate contract

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.

Example flow

  1. Read ./examples/sample-2-task.txt
  2. Ask Claude for a single triage category
  3. Register or load the local agent identity with AgentGate
  4. Lock a small bond
  5. Create a bonded email-triage action
  6. Show the email, prediction, and explanation to a human
  7. Human enters correct or one of the four categories
  8. Resolve success or failed based on exact category agreement
  9. Update the local scorecard

Honest limitations

  • 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.

Tests

The test suite covers:

  • One happy-path exact-match bonded judgment
  • One mismatch that resolves failed and slash
  • Scorecard persistence
  • Classifier response parsing