Optional and off by default. Forge identifies agents and their sessions without it; agent context only adds what an agent chooses to tell you.
Only
required: true rejects requests. Optional fields are filled less often than required ones, but no paid call ever fails because of them.
Changed in
@forgeintel/sdk 0.5.0-beta.17 and forgeintel-sdk 0.1.0b14: agent context used to be on (optional) by default, and true used to mean required. If you relied on the default, set agentContext: true. If you set true to require context, use { required: true }.agent_type and agent_search_query query parameters. Use direct as the search query when no search occurred. The SDK strips these fields before passing the request to your business handler. Before making context required on a live service, check that your paid clients can send it.
Any agent name is accepted. Common spellings are normalized (Claude and claude-code are recorded as Claude Code), and other names are kept as given. When context is required, the field only has to be present and non-empty.
Where agents see it
Forge declares the field (as optional or required, matching your setting) everywhere an agent reads your service before paying:- OpenAPI: on paid operations in the document the SDK enriches.
- The 402 challenge: in a
forge-agent-contextextension, for clients that print extensions. - Bazaar: if your route declares a
bazaarextension, Forge adds the field to its schema, with a placeholder example so the extension stays valid and your listing stays in Bazaar. Payments are unaffected; x402 accepts extensions that gain fields. Forge never adds a Bazaar declaration you didn’t make.
In the dashboard
The service’s Activity page sorts every request into one caller type:- Agents: the request carried agent context, a known agent user-agent (such as
Claude-User), or came from a detected agent wallet (awal, AgentCash, pay.sh or x402scan MCP). A wallet call without context is shown as “Unidentified agent” with its client; context adds the agent’s name and search query. - Crawlers and Monitors: known indexers and uptime probes, by user-agent.
- Unidentified: everything else, such as plain
node,curlor browser requests.