Onboarding Agents & Tools
Onboard the agents, MCP servers and tool bindings in your repository, and wire the code to the gateway, in one chat session.
Run onboarding on Sonnet-class or better. A smaller model is told to say so once and then continues, but it is more likely to miss a client or config file.
The onboarding steps
Step 1: Start onboarding
In your coding assistant, enter:
Onboard this repo to Forgebench(Or run the slash prompt /forgebench:onboard_repo)
Your assistant first checks your onboarding status. If this app's agents are already registered, it skips the scan and the plan and goes to Step 5. Otherwise it reads your repository's git remote (git remote get-url origin, credentials removed) and opens a scan, then reads the code itself: agent definitions in any framework (LangGraph, CrewAI, OpenAI Agents SDK, AutoGen, Strands, Mastra, Vercel AI SDK), each agent's LLM client, every tool each agent can call (MCP tools and app-local or framework tools), MCP client configuration and the workflows that group the agents. It reports what it found to Forgebench; nothing is registered yet.
In a Java repository it also finds agents built on the Forgebench Java SDK, Spring AI, LangChain4j and Google ADK for Java. A service that builds a Forgebench client or a Spring AI ChatClient is one agent, named after its Maven artifactId or Gradle project.
Forgebench derives the repository's identity from the git remote on the server. A second run of onboarding on the same repository matches the agents it registered the first time instead of creating them again. Because the remote is reported by your assistant rather than verified from the repository, the review lists it as an assistant-asserted identity, and it only matches agents you own.
Step 2: MCP servers and their tools
Your assistant reports the MCP servers your code connects to and the tools each agent can call. Forgebench never starts or contacts those servers during onboarding. Two cases are flagged in the review:
- A partial tool list. If your assistant could not list every tool of a server, the review warns that the list is partial. A model call to a tool that is not registered and bound is refused by the tool gate, so ask your assistant to report the missing tools before you plan.
- A server whose URL is configured at runtime (for example from an environment variable). It is registered pending its endpoint: it cannot be called until you configure the endpoint in the console.
For MCP servers you are connected to in your own client, your assistant can also report the tools it sees.
Step 3: Review the catalog diff & customize
Your assistant summarizes what will be added to your workspace:
Reviewing scan findings:
New Agents:
+ researcher-agent (LangGraph, src/agents/researcher.py)
+ analyst-agent (CrewAI, src/agents/analyst.py)
+ test-fixture-bot (LangGraph, tests/agents/test_bot.py)
MCP Servers & Tools:
+ postgres (3 tools: postgres_query, postgres_list_tables, postgres_drop_table)
⚠️ Warning: postgres_drop_table is classified as a DESTRUCTIVE tool.
Proposed Policies:
- Monthly budget: the workspace's agent policy, clamped to its budget
- Daily key limit: the workspace's agent policy
What would you like to include, exclude, or customize?Customize the plan in chat:
Exclude test-fixture-bot.
Set researcher-agent monthly budget to $30.
Proceed with analyst-agent at default.Things to check before applying:
- Name collisions: if an agent with the same name exists, Forgebench suggests a unique name such as
researcher-agent-2. - Test fixtures: exclude any test agents your assistant picked up.
- Destructive tools: tools that drop, delete or truncate are flagged so you can decide whether to unbind them.
Step 4: Confirm and apply
Your assistant shows the final change plan:
Change Plan [plan_id: plan_883fc2]:
- Register agent 'researcher-agent' [Monthly Budget: $30.00 USD]
- Register agent 'analyst-agent' [Monthly Budget: workspace default]
- Catalog MCP Server 'postgres' [3 tools]
- Bind 'analyst-agent' -> ['postgres_query', 'postgres_list_tables', 'postgres_drop_table']
Shall I apply this plan?Confirm by saying:
Yes, apply.The plan also registers registry tools (every tool that is not an MCP tool, including framework tools such as handoff_to_agent), binds agents to MCP servers and registry tools, and pins one environment variable name to each agent (see Step 5).
Workflows found in the repository are not created by the plan. After the agents are registered, Forgebench records each workflow as a suggestion over those agents. Accept a suggestion with forgebench_workflows (register_from_suggestion), which attaches the existing agents and creates none. An agent belongs to one workflow, so when workflows share agents the first workflow keeps them: a later workflow is accepted with the agents left (a partial workflow) or reported as skipped with a reason. A workflow with task edges is confirmed in the console.
Your agents are registered in the workspace catalog with sealed credentials. They cannot make calls until a person claims a key in the browser. Each item runs in chat, needs confirmation in the console, or becomes an approval request; your assistant lists the ones that need a link from you. When the plan has run, the result names the next action: a follow-up plan first, otherwise the integration steps below.
Change plans expire after 30 minutes. If yours expired, ask your assistant to generate it again, or drop a plan you no longer want with forgebench_plan (cancel).
Applying the plan does not finish onboarding. The apply result says so and lists what remains: wiring your code to the gateway with forgebench_onboarding integrate, then forgebench_integrate verify.
Wire the code to the gateway
Step 5: Claim your keys
Your assistant reads each agent's stage and posts one claim link for every registered agent. An agent moves through four stages:
| Stage | Meaning |
|---|---|
| pending approval | Waits for a console confirmation or an admin approval; no claim link until a re-run finds it registered. |
| registered | The agent exists and has no claimed key. It gets a claim link. |
| key claimed | Someone revealed the key. It gets no new link unless you ask to rotate it. |
| live | The agent has made a governed call. |
Each agent reads its key from one environment variable. One agent uses FORGEBENCH_API_KEY. Two or more agents use FORGEBENCH_KEY_<AGENT_NAME>, the agent name in upper snake case, for example FORGEBENCH_KEY_RESEARCHER_AGENT. For agents registered through onboarding the name is pinned when the agent is registered 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. The key reveal page shows the pinned name; for an unpinned agent your assistant gives the name with the link. See Budgets & Agent Keys.
Step 6: Review the changes to your code
Your assistant reads your code to find each agent's LLM client, provider SDK and where each config value lives (settings, YAML, OAI_CONFIG_LIST, application.yml, an agent's MCP client JSON). It fetches a per-agent manifest with forgebench_onboarding integrate: the variable names, a checklist and the recipe topics to follow. The scan ID is optional, so this also works for already registered agents.
It then shows one reply with:
- The per-agent diff: agent, file, line, SDK and the change.
- The guardrail mapping table: each guardrail your code already runs on model output (PII redaction, secret filters, denylists, regex on output) and the Forgebench check it maps to, or "stays in your code, not represented in Forgebench".
- Opt-ins:
X-Agent-Version, dimensions and sessions, lineage, refusal handling, MCP gateway client config and A2A code.
You accept or decline each item in one reply. Nothing is edited before that reply.
Step 7: Edits and self-check
Your assistant edits the code and the config files where the values live: the gateway address and key are read from the environment, .env.example gets the names with no value, and .env goes in .gitignore. Direct Anthropic, Bedrock or Google calls move to the gateway's OpenAI-compatible client. A provider key written into the code is removed and you are told to rotate it; the key is never printed. Where two agents share one client, each gets its own client built from its own variable.
Afterwards it checks its own work: no literal ${...} left in a JSON config, no /v1 mismatch in the gateway address, no deleted config file, no leftover key, and variable names exactly as the manifest gives them. It may run your repository's existing compile, typecheck and lint commands, never the app or its tests.
Step 8: Mirror guardrails (optional)
If you accepted the mapping table, your assistant mirrors the outbound checks it mapped into Forgebench with forgebench_manage_guardrails: agent-scoped denylist terms, scanning on, and the PII and secrets checks. Your own guardrail code is left untouched. Outbound guardrails in Forgebench flag or log; they do not block. This needs the Pro plan or higher. See Guardrail findings. If you decline the table, nothing is mirrored.
Step 9: Set the secrets and verify
Your assistant prints the secret commands, such as gh secret set NAME and kubectl create secret generic ... --from-env-file=<file>. You run them in your own terminal. Then set the variables in that terminal, run the app yourself and ask your assistant to verify. It calls forgebench_integrate verify with agent_name for each agent, adding tools=true for agents with registry tools or MCP servers and workflow=<slug> for a workflow. If the result is pending, it verifies once more before reporting the agent as not live.
Step 10: What is left for you
Your assistant ends with a handoff list:
- In the console: A2A grants and the Connect-server steps.
- Ask your admin: the provider credential, the model allowlist, other people's agents, tool registrations that failed, pending approvals, and guardrail mirroring on a plan below Pro.
- Blocking guardrails: your client's blocking or inline guardrails are not mirrored. Set them up in the console: open Guardrails, then the Inline enforcement tab; see Use your own guard model.
- Rotate: any key your assistant removed from the code.
- Enterprise: run
forgebench setupfor Session Insights.
Next
Budgets & Agent KeysClaim API keys for your agents and manage spend limits.

