Documentation · v3.2

Build with AgentDOM

The complete reference for agents, developers, and publishers.

Up and running in 2 minutes

Install the CLI, authenticate with any SaaS provider once, and start dispatching intents immediately.

terminal
# No install needed — npx works immediately
npx agentdom@latest setup linear.app   # OAuth PKCE
npx agentdom@latest setup resend.com   # API key prompt
npx agentdom@latest run "Create a Linear ticket for the login crash"

# For permanent install — fix permissions first (macOS)
mkdir -p ~/.npm-global && npm config set prefix ~/.npm-global
echo 'export PATH="$HOME/.npm-global/bin:$PATH"' >> ~/.zshrc && source ~/.zshrc
npm install -g agentdom

dispatch_intent

The single function that makes AgentDOM work. Agents declare what they want — AgentDOM picks the fastest available transport (API › CLI › Browser › Desktop).

agent code
// Dispatch a single intent directly
dispatch_intent("issues.create", {
  title:    "Login crash on iOS 17",
  priority: 1,
  teamId:   "ENG"
}, "linear.app")

// → wallet fetches Keychain token
// → POST https://api.linear.app/graphql
// → { success: true, issue: { id: "ENG-42" } }
TransportUsed whenLatency
apiProvider has REST/GraphQL manifest~120ms
cliCLI tool available locally~200ms
browserNo API, falls back to CDP web automation~300ms
desktopNative macOS app via Accessibility API~100ms

Connect to Claude, Cursor, or any MCP client

AgentDOM runs as an MCP server (stdio). Any agent framework that speaks MCP gets 50+ tools automatically.

setup
# Claude Code — add in one command
claude mcp add agentdom-desktop -- node \
  $(npm root -g)/agentdom/desktop-mcp-server.js

# claude_desktop_config.json
{
  "mcpServers": {
    "agentdom": {
      "command": "node",
      "args": ["$(npm root -g)/agentdom/desktop-mcp-server.js"]
    }
  }
}
Tool exposed via MCPWhat it does
dispatch_intentExecute any intent on any connected provider
wallet_authAuthenticate a new provider
wallet_listList all authenticated providers
policy_listShow current policy rules
memory_recallSearch past agent runs
clickElementClick by label — no selectors needed
typeTextType into any input field
observeRead desktop state, clipboard, running apps

The only step that needs a human

Run agentdom setup once per provider. It handles OAuth, device flow, or API key prompts automatically — then stores the token in your OS Keychain. After this, agents run forever without any human involvement.

Design principle: Human consent is required exactly once per provider. Everything after that — token refresh, dispatch, rotation — is fully headless.
terminal
# One-time setup — run this once per provider, then agents run forever
agentdom setup linear.app         # opens browser → OAuth PKCE → refresh token stored
agentdom setup github.com         # device flow → enter code at github.com/login/device
agentdom setup resend.com         # prompts for API key → stored in Keychain
agentdom setup openrouter.ai --key=sk-or-v1-xxx  # non-interactive

# Check what's set up
agentdom setup --list

# After setup — package credentials for your agent
agentdom wallet export --base64 --providers=linear.app,resend.com
# → AGENTDOM_WALLET_B64=eyJ3YWxsZXQi...  (single env var)

OAuth PKCE

Browser opens once. Approve. Refresh token stored forever.

Device Flow

Enter code at URL. No redirect. Works in any terminal.

API Key

Paste once. Encrypted in Keychain. Never asked again.

Tokens that never leave your machine

One consent per provider. Tokens stored in your OS Keychain (macOS Keychain Access, Windows Credential Manager, Linux libsecret). Auto-refreshed 5 minutes before expiry.

OAuth 2.0 PKCE

Opens browser for user consent. No client secret needed. PKCE secured.

Device Flow

For GitHub and headless environments. No browser required.

API Key

Prompts once, stores securely in Keychain. Never in plaintext.

Auto-refresh

Background scheduler refreshes tokens 5 min before expiry silently.

# Credential resolution order (automatic)
0. Agent Token Protocol # publisher-issued scoped tokens (best)
1. AGENTDOM_<HOST>_KEY # env var
2. ~/.agentdom/wallet.json # local wallet
3. OS Keychain # macOS / Windows / Linux
4. AWS SSM # /agentdom/<host>/token
5. HashiCorp Vault # secret/agentdom/<host>
6. 1Password # op://AgentDOM/<host>/token

Give credentials to your agent

After agentdom setup, export your wallet and inject it into any agent — Docker container, serverless function, CI job, or remote server. Three delivery methods, zero human interaction at runtime.

terminal
# 3 ways to give an agent its wallet — no human at runtime

# Option 1: Base64 (Docker / serverless / CI)
export AGENTDOM_WALLET_B64=$(agentdom wallet export --base64 --providers=resend.com)
docker run -e AGENTDOM_WALLET_B64=$AGENTDOM_WALLET_B64 your-agent

# Option 2: File path (server / multi-agent)
agentdom wallet create --agent=email-bot --providers=resend.com
AGENTDOM_WALLET_PATH=~/.agentdom/email-bot.wallet.json agentdom goal "..."

# Option 3: Env vars (GitHub Actions / Doppler / Vercel)
agentdom wallet env  # prints these:
export AGENTDOM_RESEND_COM_KEY=re_xxx
export AGENTDOM_LINEAR_APP_KEY=lin_xxx
CommandPurpose
agentdom wallet listShow all stored credentials
agentdom wallet export --base64Single env var for Docker/CI
agentdom wallet create --agent=idScoped wallet per agent identity
agentdom wallet import <file|b64>Load wallet from file or string
agentdom wallet envPrint shell export lines
agentdom wallet token <host>Print raw token for a provider

Publishers issue tokens directly to agents

A new M2M auth standard built on top of .well-known/agentdom.json. Publishers declare an agent_tokens endpoint. Agents call it with their master credential and receive a short-lived, scoped token — no browser redirect, no human approval.

Analogy: Like AWS IAM roles for EC2 — the machine provisions its own short-lived credentials using a trust relationship. The master key never reaches the agent runtime.
agent_tokens protocol
# Publisher declares in .well-known/agentdom.json:
{
  "auth": {
    "method": "api_key",
    "agent_tokens": {
      "issue":  "POST https://api.yourapp.com/agent-tokens",
      "revoke": "DELETE https://api.yourapp.com/agent-tokens/{id}",
      "rotate": "POST https://api.yourapp.com/agent-tokens/{id}/rotate",
      "scopes": ["emails:send", "domains:read"],
      "max_ttl_seconds": 86400
    }
  }
}

# Agent provisions its own scoped token — no human needed:
agentdom agent-token resend.com --scopes=emails:send --ttl=3600
# → POST /agent-tokens with master key → scoped token stored → auto-rotates

# dispatch_intent uses it automatically:
dispatch_intent("emails.send", { to, subject, html }, "resend.com")
# → secrets.resolve() tries agent_tokens protocol first
# → master key never exposed to agent runtime

Auto-rotation

Tokens rotated 5 min before expiry. Agent never handles stale credentials.

Scoped access

Agent gets only the permissions it needs. Master key stays in vault.

Zero human steps

After one-time setup, agents provision and rotate their own tokens forever.

Publisher-native

Publishers add 5 lines to their manifest. Works with any existing token issuance system.

Human-in-the-loop when it matters

Every intent is classified by side effect before execution. You control which effects need approval, which are auto-allowed, and which are always denied.

~/.agentdom/policy.json
// ~/.agentdom/policy.json
{
  "per_class": {
    "read":     "allow",
    "external": "prompt",   // API writes need approval
    "send":     "prompt",   // emails need approval
    "delete":   "deny",    // never auto-delete
    "payment":  "deny"     // never auto-charge
  }
}

// Approve / deny from CLI
agentdom policy show
agentdom approve abc123
agentdom deny   abc123

Agents that learn and plan

AgentDOM includes two runtime layers that make agents reliable across sessions.

Episodic Memory

Cross-session JSONL store. Agents recall what worked and what failed per provider. Query with agentdom memory recall.

Plan-Execute-Verify

Goals are broken into explicit JSON plans. Each step is policy-checked, executed, and verified. Failures trigger automatic replanning.

Make your API agent-native in 6 steps

Publish a .well-known/agentdom.json manifest and every AgentDOM agent can instantly discover and use your product — no per-framework integration needed.

terminal
# Step 1: Generate manifest from your OpenAPI spec
npx agentdom-publisher init \
  --openapi=./openapi.json \
  --host=api.yourapp.com

# Step 2: Validate locally
npx agentdom-publisher validate

# Step 3: Deploy .well-known/agentdom.json to your server
# Step 4: Verify live
npx agentdom-publisher verify --host=api.yourapp.com

# Step 5: Test a real dispatch
npx agentdom-publisher test \
  --host=api.yourapp.com --token=sk-... --intent=contacts.list

# Step 6: Submit to public registry
npx agentdom-publisher submit --host=api.yourapp.com
No OpenAPI spec? Hand-craft the manifest — the format is minimal. See the example below.

.well-known/agentdom.json

The open standard. Agents fetch this once, cache it, and call your API directly.

.well-known/agentdom.json
{
  "version": "1.0",
  "host":    "api.yourapp.com",
  "auth": {
    "method":    "api_key",
    "key_header": "Authorization",
    "key_format": "Bearer {token}"
  },
  "capabilities": [{
    "intent":      "contacts.create",
    "transport":   "api",
    "method":      "POST",
    "endpoint":    "https://api.yourapp.com/contacts",
    "side_effects": ["external"]
  }]
}
side_effect valueMeaningDefault policy
readGET data, no mutationauto-allow
externalWrite to external serviceprompt
sendSend email / notificationprompt
deleteDelete a recorddeny
paymentCharge a carddeny
write_localWrite to local filesystemallow

12 built-in polyfill providers

These manifests are bundled with AgentDOM and also served from agentdom.dev/manifests/. Agents work with all of them on day one — no vendor action required.

ProviderAuthIntentsCovers
linear.appOAuth28issues, teams, comments
hubspot.comOAuth28contacts, deals, companies
vercel.comAPI Key8deployments, projects, env vars
slack.comOAuth26messages, channels, reactions
notion.soOAuth26pages, databases, blocks
supabase.comAPI Key7projects, secrets, SQL
resend.comAPI Key5emails, domains
cal.comOAuth26bookings, availability
github.comDevice811repos, issues, PRs, and more
stripe.comAPI Key442payments, customers, subscriptions
openai.comAPI Key5chat, embeddings, images
anthropic.comAPI Key2messages, models