Skip to content

[DOCS] AgentMail inbox and API key for Markdown agents #1126

Closed

Description

@inference-gateway-maintainer

User-facing change: PR inference-gateway/desktop#458 (issue inference-gateway/desktop#415) gives each Markdown agent an AgentMail identity: an inbox address, the API key that owns it, and a send whitelist.

What changed

  • The agent editor has an Email section: inbox address, AgentMail API key, allowed recipients, and a Create inbox action that provisions a <name>@agentmail.to inbox through AgentMail. Mock mode answers provisioning locally.
  • The agent file's frontmatter gains two desktop-only keys: email (the inbox address) and email_to (comma-separated addresses the agent may send to). The API key is never written into the file: it is stored in ~/.infer/auth.yaml under AGENTMAIL_API_KEY_<agent>, which Export and Import refuse to carry.
  • A chat with an agent that has an inbox gets the hosted AgentMail MCP server with the agent's API key in the x-api-key header and AGENTMAIL_API_KEY in the worker environment, so the agent (and any run it spawns) can send, read and reply mail as that identity once the CLI applies per-thread mcp_servers and env on resume_conversation ([cli] resume_conversation: apply per-thread mcp_servers and env to workers cli#1754).
  • The sidebar agent row, the composer chip and the agent's preamble show or state the address and the send whitelist.

Affected pages

  • The Markdown agents documentation where the agent file's frontmatter keys are listed: add email and email_to as desktop-only keys and note the API key never travels in the file.
  • The agent editor walkthroughs, if they enumerate its sections.
  • The credentials or export documentation, if any, noting agent API keys live in auth.yaml beside the provider keys and never travel in exports.

Activity

  1. added
    documentation
    on Nov 8, 2026
  2. edenreich commented on Nov 8, 2026

    @edenreich
    Contributor

    Key names changed in desktop#458 before merge: agent files use allowed_recipients (a YAML block list of addresses or domains) instead of email_to. ~/.infer/config.yaml gains an optional agent_mail.allowed_recipients cap that applies to every agent. An agent with no allowed recipient can only mail itself. Threads get an inbox-scoped key that expires after 7 days, never the owner key.

  3. edenreich commented on Nov 8, 2026

    @edenreich
    Contributor

    @claude can you document this?

  4. inference-gateway-maintainer commented on Nov 8, 2026

    @inference-gateway-maintainer
    ContributorAuthor

    Claude finished @edenreich's task in 2m 23s —— View job • docs/issue-1126-20261108-1342


    Documented the AgentMail inbox for Markdown agents

    • Read the issue and the maintainer's key-name correction (allowed_recipients, not email_to)
    • Located the page: desktop.md - Your own agents frontmatter table and the API keys section
    • Added email and allowed_recipients to the frontmatter table as desktop-only keys
    • New Agent email section under Your own agents
    • Note in API keys that auth.yaml also holds per-agent keys, and exports leave them behind
    • bun run lint:md, bun run format:check, bun run build - all clean
    • Committed and opened the PR

    What the new section covers

    • The editor's Email section: inbox address, AgentMail API key, allowed recipients, and Create inbox provisioning <name>@agentmail.to (answered locally in mock mode).
    • A frontmatter example with allowed_recipients as a block list of full addresses or bare domains, plus the safe default: an agent with no allowed recipient can only mail itself.
    • The machine-wide agent_mail.allowed_recipients cap in ~/.infer/config.yaml.
    • AGENTMAIL_API_KEY_<agent> in ~/.infer/auth.yaml, never in the agent file, and refused by both export and import.
    • The hosted AgentMail MCP server a chat gets, handed an inbox-scoped key that expires after 7 days rather than the owner key.
    • Where the address and whitelist show up: sidebar agent row, composer chip, and the agent's preamble.

    I kept this to one new ### section rather than touching the editor walkthrough separately - the walkthrough does not enumerate editor sections, so there was nothing to extend there. No x-api-key header detail: that is an implementation detail of the MCP wiring, not something a reader acts on.

    Create a PR - already opened as #1127.
    | Branch

  5. moved this from Todo to In progress in 2026on Nov 8, 2026
  6. moved this from In progress to QA in 2026on Nov 8, 2026
  7. edenreich commented on Nov 8, 2026

    @edenreich
    Contributor

    The wiring paragraph changes: the CLI will not apply mcp_servers and env on resume_conversation (inference-gateway/cli#1754 closed with the rationale). The agent reaches AgentMail through a hosted server entry in mcp.yaml (inference-gateway/cli#1755) and the key comes from the computer the agent runs on, a Kubernetes workspace Secret (inference-gateway/cli#1756) or the local auth.yaml. The editor, frontmatter and export parts of this ticket still hold. The CLI-side docs are tracked in a separate [DOCS] issue linked from those two.

  8. edenreich commented on Nov 8, 2026

    @edenreich
    Contributor

    Correction to my previous comment: the local ~/.infer/auth.yaml is not a source for the agent's key. Only the gateway and A2A supervisors read that file, and ${VAR} in the CLI's mcp.yaml expands from the process environment. On a local machine the key has to be in the environment infer daemon runs with, and on a Kubernetes workspace it comes from that workspace's secrets (inference-gateway/cli#1756).

    PR #1127 is updated to match: the page no longer says a chat gets the hosted AgentMail server with a 7-day key, because the CLI never applied that. It now says an agent's chats cannot send or read mail yet. The desktop side of the new wiring is inference-gateway/desktop#473.

  9. moved this from QA to Done in 2026on Nov 8, 2026
  10. inference-gateway-releaser commented on Nov 8, 2026

    @inference-gateway-releaser
    Contributor

    🎉 This issue has been resolved in version 0.9.24 🎉

    The release is available on GitHub release

    Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationreleased

    Type

    No type

    Projects

    • Status
      Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions