AgentBook is an address-book safety layer for agent-to-agent collaboration over email-like transports such as AgentMail. It provides scoped trust: unknown senders are quarantined by default, known contacts are constrained by explicit policy, and outbound messages are validated before they can be sent.
This repository is intentionally SkillMD/CLI-first, Hermes-native second, MCP-optional later. The portable contract is a deterministic agentbook CLI plus skills/docs that teach agents when to call it. The Hermes plugin wraps the same policy as native Hermes tools.
Network AgentMail send/fetch is intentionally stubbed in v0.2; the project focuses on profile-safe local storage, policy validation, handshakes, and redacted audit logs.
- Stores contacts in
get_hermes_home()/agentbook/address_book.yaml - Stores redacted audit decisions in
get_hermes_home()/agentbook/audit.jsonl - Classifies unknown senders as
unknownwith aquarantinedecision - Quarantines unknown inbound email silently — no auto-reply, no inbox validation leak
- Requires trusted contacts and scoped permissions for outbound validation
- Denies raw arbitrary
toaddresses in favor ofcontact_idresolution - Generates nonce-based handshake messages for human/owner verification flows
- Bundles
plugin:agentbookandplugin:agentmail-collaborationskills with usage and safety guidance - Supports webhook-based inbound processing via AgentMail
message.receivedevents with Svix signature verification - Supports scoped trusted owner email instructions for low-risk owner commands such as
wiki_file,summarize,reply_confirm, andschedule_task; dangerous scopes such ascode_or_shellshould require an out-of-band confirmation step
agentbook_contacts— list/get/add/update/remove contactsagentbook_lookup— resolve a known contact by id or emailagentbook_classify— classify a sender as trusted, pending, blocked, revoked, or unknownagentbook_validate_outbound— validate an outbound AgentMail payload and return a dry-run payloadagentbook_handshake— initiate/accept/reject/status for contact handshakesagentbook_validate_address_book— validate local policy fileagentbook_audit— tail/query redacted audit entries
hermes plugins install timfoo/agentbook --no-enable
hermes plugins enable agentbookRestart Hermes or start a fresh session after enabling the plugin.
python -m pip install -e .
agentbook --helpThe CLI is the universal enforcement path for hosts that can run shell commands. Claude Code should follow CLAUDE.md / docs/claude-code.md and call the CLI before any external send.
Common commands:
agentbook contacts list
agentbook contacts add alice --email alice@example.com --status trusted --scopes send,reply,handshake
agentbook lookup --contact-id alice
agentbook classify alice@example.com
agentbook validate
agentbook validate-outbound --contact-id alice --subject "Project update" --text "Safe summary" --dry-run
agentbook audit tail --limit 20MCP is optional. Add it later only for hosts that require MCP-native tool discovery.
The manifest declares AGENTMAIL_API_KEY as optional. v0.2 does not send network messages; future versions can use the same trust/policy layer for real AgentMail send/fetch. Do not commit your API key. Keep secrets in your Hermes .env or configured secret store.
version: 1
self:
inbox_id: ""
email: ""
display_name: ""
defaults:
unknown_sender_policy: deny
attachments: deny
max_body_chars: 12000
require_handshake: true
contacts:
alice:
email: alice@example.com
display_name: Alice Agent
agent_type: agent
status: trusted
scopes: [send, reply, handshake]
allow:
send: [alice@example.com]
cc: []
labels: []
max_body_chars: 12000
handshake:
state: accepted
notes: Project-scoped collaborator
tim-owner:
email: tim@example.com
display_name: Tim Owner
agent_type: human
status: trusted
scopes: [send, reply, owner_instruction, wiki_file, summarize, reply_confirm, schedule_task]
allow:
send: [tim@example.com]
cc: []
labels: [trusted-owner]
max_body_chars: 12000
handshake:
state: accepted
notes: Owner email may issue scoped low-risk instructions; require out-of-band confirmation for code_or_shell, destructive changes, third-party sends, credentials, money, or irreversible actions.AgentBook can represent the owner as a trusted human contact whose email may issue scoped instructions to the local agent. This is distinct from ordinary collaborator trust: a known sender gets only the scopes in their contact record.
Recommended owner scopes:
owner_instruction— may include an instruction block at the top of an inbound email.wiki_file— may ask the agent to file forwarded material into the Wiki/knowledge base.summarize— may ask for summaries or extraction.reply_confirm— may receive a confirmation reply after verified completion.schedule_task— may create low-risk reminders or follow-up jobs.code_or_shell— high-risk; do not enable by default. If present, still require an out-of-band confirmation step before executing commands, installing software, changing config, or performing destructive actions.
Recommended inbound owner-forward flow:
- Classify sender with
agentbook classify <sender-email>. - Require
classification=trusted,decision=allow, andowner_instructionscope. - Split the owner instruction block from forwarded/source content.
- Execute only scopes present on the owner contact.
- For low-risk Wiki/summarization tasks, verify the artifact exists before labeling the message
read+processedor sending a confirmation. - For unsupported, ambiguous, or dangerous instructions, keep the message
unread, addflagged-for-review/needs-confirmation, and ask the owner over the primary channel. - Never let trusted email become a remote shell; trust is scoped authorization, not blanket obedience.
python -m pip install -e .[dev]
python -m pytest -q
python -m compileall -q .The tests stub hermes_constants.get_hermes_home() so they can run outside a full Hermes checkout.
- Unknown senders are never automatically trusted.
- Outbound validation requires
contact_id; raw recipient strings are denied. - Audit logs hash recipient and subject values and do not store API keys or full message bodies.
- Attachments and autonomous unknown-sender promotion are out of scope for the MVP.
MIT