Agents Agents

Agents

The agent inventory lists every governed agent: who owns it, its state, whether it has a spend ceiling, and when it was last seen.

Registering an agent: name, owner, model, description and feature tags, through to the credential issued on submit

The lifecycle

An agent is in one of four states:

StateMeaning
registeredHas never made a governed call. Its credential can be issued or sealed pending a browser claim. Check credential state and the deployed service if expected traffic is missing.
activeHas made at least one governed call. The first call sets this automatically.
pausedIts calls are refused. Someone paused it, or guardrail auto-pause did when findings crossed the threshold.
retiredOut of service, with credentials revoked and history kept. An admin can restore it directly; its owner can request approval. It then needs a new credential and resume. See Retire and restore.

Retire and restore

Retire an agent from Lifecycle on its record. A retired agent stays in the inventory with its history, and its keys are revoked for good.

To bring it back, select the retired agent in the inventory and choose Restore, or choose Restore agent under Lifecycle on its record. Admins, owners and the agent's own owner see the action.

  • Admin or owner: Restore applies at once. A reason is optional and is kept in the audit record.
  • The agent's owner: Request restore sends an agent.restore approval to the admins and owners you pick. A reason is required. The agent comes back once one of them approves.

The agent returns paused. Its old keys never work again. To give it a working key, choose Rotate credential, then resume the agent.

Register an agent

Registration requires builder access or agents:write. The plan's resource cap also applies; Free allows two agents. Pause, retirement, restore, and purge require the agent lifecycle entitlement, available on Pro and Enterprise.

  1. Click Register on the inventory

    Opens the registration dialog.

  2. Name the agent

    For example invoice-classifier. The name appears on every inventory row and audit entry.

  3. Assign an owner (required)

    The person accountable for the agent. Only admins, and roles with the agents:assign_owner permission, can name someone else; anyone else registers the agent under their own name. The same rule applies when you reassign an agent later.

  4. Choose the model (required)

    The model the agent runs on. The console also sets the credential's allowed_models to that model. On chat calls with the agent credential, the configured model overrides the request's model. Change the configured model from the agent's page; model changes follow the applicable approval and ownership policy.

  5. Describe what it does

    Optional. The tool-suggestion pass uses it, and colleagues read it when deciding whether the agent can be turned off.

  6. Add feature tags

    Optional, comma-separated (for example checkout, invoicing, pii-sensitive). Spend, refusals and findings roll up by feature as well as by agent.

  7. Choose when its key expires

    Optional. Key expiration starts at No expiration. Choose a length (7 days to 1 year) and the agent's key stops working that long after it is issued. Each rotation gives it the same length again. Once it expires, the agent's calls get 401 {"detail":"api key expired"} until someone rotates the key.

  8. Click Create agent

    Forgebench creates the agent and its credential. The credential is shown once; copy it before closing the dialog. The agent starts as registered, with no tool access.

The credential is shown once after agent creation. Copy it before closing this dialog.
The credential is shown once after agent creation. Copy it before closing this dialog.

The same screen shows a ready-to-copy call in curl, Python or the OpenAI SDK shape, with the key filled in and the X-Agent-Version header to send. An indicator changes when the agent's first call arrives.

Set its spend ceiling

Registration applies the workspace's agent budget policy. Without a saved policy, the monthly defaults are $5 on Free, $25 on Pro, and $100 on Enterprise, clamped to the workspace cap. Key daily, request-rate, model, and MCP-call limits are also applied. Check the returned applied_caps and edit the per-agent monthly cap in Budgets.

  1. Go to Budgets → Per-agent caps

    Each agent is listed with its monthly cap, spend so far and remaining balance.

  2. Click Edit on the agent's row

    Opens Edit monthly cap: <agent name>.

  3. Set the monthly limit (USD)

    Set a cap within the workspace budget. Builders can lower a cap and raise it only to their self-service ceiling. Removing a cap requires an admin.

  4. Save

    The cap applies immediately, alongside the workspace budget.

Call from your code

The credential from registration is the agent's API key. Store it where your service reads secrets. Calls with it are attributed to the agent in traces, audit and budgets.

The examples read the key from FORGEBENCH_API_KEY. A repository onboarded with several agents gives each agent its own variable, FORGEBENCH_KEY_<AGENT_NAME> in upper snake case, so each agent builds its own client from its own key. For agents registered through onboarding the name is pinned and never renamed; for agents registered elsewhere it is computed from the agent count (the manifest marks them unpinned) and can change when the count changes. Reveal each key once: a second claim rotates it. See Budgets & Agent Keys.

import os
from forgebench import Forgebench, ForgebenchError

client = Forgebench(api_key=os.environ["FORGEBENCH_API_KEY"],
               base_url="https://api.forgebench.ai")

try:
  resp = client.chat.completions.create(
      model="gpt-4o",
      messages=[{"role": "user", "content": "..."}],
  )
except ForgebenchError as e:
  log.error("call failed: %s", e)

The agent's configured model is authoritative for its credential's chat calls. Model allowlists and routing restrictions are additional checks. Registration through the API inherits the workspace's model policy when allowed_models is omitted; an explicit null requests an unrestricted credential, subject to the remaining policy checks. The console pins it to the chosen model.

Tool bindings and guardrail scanning need no code changes. You configure them for the agent in Tool Registry, MCP and Guardrail findings.

Handle agent-specific errors

Besides the general codes in Errors and refusals, two errors are specific to agents:

StatusCauseBody
401A paused agent is refused at authentication. Retirement revokes its keys, so an old retired-agent key normally reports api key revoked.{"detail": "agent is paused"}
403model_not_allowed: the call named a model not in the credential's allowed_models.{"detail":{"error":"model_not_allowed","model":...,"allowed_models":[...]}}

A paused agent, revoked credential, and unknown key all return 401. Check the body for agent is paused, api key revoked, or unknown api key before deciding whether to resume the agent or replace a credential.

For model_not_allowed, e.code is None: the identifier is in detail.error, not detail.code (unlike tool_not_authorized and mcp_tool_not_authorized). Branch on e.body["detail"]["error"]:

import os
from forgebench import Forgebench, AuthenticationError, PermissionDeniedError

client = Forgebench(api_key=os.environ["FORGEBENCH_API_KEY"],
               base_url="https://api.forgebench.ai")

try:
  resp = client.chat.completions.create(model="gpt-4o", messages=[{"role": "user", "content": "..."}])
except AuthenticationError as e:
  log.error("agent auth failed: %s", e)
except PermissionDeniedError as e:
  detail = (e.body or {}).get("detail", {})
  if detail.get("error") == "model_not_allowed":
      log.error("model %s not allowed; allowed: %s", detail["model"], detail["allowed_models"])
  else:
      log.error("not authorized: %s", e.body)

Inventory columns

  • Owner: who to ask.
  • Tags: filter the inventory by feature.
  • State: one of the four agent states.
  • Version: the latest X-Agent-Version reported by the calling service.
  • Budget: whether a ceiling is set. Blank means no per-agent cap.
  • Error rate: tool-call failures. A rising rate usually means a tool changed.
  • Last seen: the agent's most recent call.

Agent detail

Open a row to see one agent's credential, policy, version history and recent tool activity. Start here when an agent behaves unexpectedly.

Agent detail: Overview, the Tools allowlists, and version history
TabWhat it shows
OverviewWhat the agent may do: its MCP and Registry tool access and its model, plus its most recent calls and bound tools.
ToolsTwo allowlists: MCP allowlist (see MCP) and Registry (see Tool Registry). With nothing bound in either, the agent can call no tools.
CredentialsRotate the credential if it is lost or compromised; the agent keeps its identity and history. Rotation replaces the stored secret with no planned overlap, so prepare the service to use the replacement. Already admitted calls are not cancelled. Revealing a credential through a claim link for an agent with a live key also rotates it.
VersionsBuilt from the X-Agent-Version header on each call. Empty until the agent sends that header.
Calls, Tool activity, GuardrailsTraces, tool-call history and guardrail findings for this agent only.

Any string works as a version, and a new value shows up as soon as the client sends it. Set the header once when you construct the client:

from forgebench import Forgebench

client = Forgebench(
  api_key="sk_...",
  base_url="https://api.forgebench.ai",
  default_headers={"X-Agent-Version": "1.4.0"},
)

resp = client.chat.completions.create(
  model="mock-gpt",
  messages=[{"role": "user", "content": "hello from invoice-classifier"}],
)

The TypeScript chat methods accept per-call headers in their second argument. For Python and Java chat calls, use a separate client with different default headers to report a different version from the same process.

The right-hand rail shows State, Ownership, Limits (model and per-agent monthly cap), Activity this cycle, Bindings, Feature tags and Lifecycle, where you retire the agent.

Next

Cookie settings

Our Cookie Policy lists every cookie and what it does.