← Back

← All guides · Published November 14, 2026 · Reviewed November 14, 2026 · Ingenious AI team

What Is a Token Forge in an Agent Log?

The short answer

A token forge is a logged action where a token-minting, token-refreshing, key-rotating or role-assuming tool runs outside the declared auth_flow_tools — the tools you named as allowed to mint tokens. It is high severity because minted tokens are standing permission: a forge does not just touch a boundary, it manufactures new access. The same call can also be a scope escape, but the forge finding is the one that tells you to look at the tokens it created. Check your own log with the free log scan.

Scan my log — free

What is a token forge?

In BoundaryVault, token-forge is the pattern for token-minting tools — mint_token, refresh_token, create_api_key, assume_role and similar — executing outside the declared auth flow. If no auth_flow_tools are declared, there is no legitimate minting path to compare against, which is itself the first thing to fix.

Why minting gets its own pattern

Most tool calls spend existing permission; minting creates new permission. A forged or merely undeclared mint leaves behind tokens that outlive the log entry — they can be used later, from elsewhere, by whoever holds them. That persistence is why the detector separates token-forge (high severity) from ordinary scope escape (medium): the response differs. An escape asks 'was this tool allowed?'; a forge additionally asks 'what tokens exist now that should not, and have they been used?' Your incident worklist grows a revocation section the moment a forge is confirmed.

Declaring a legitimate auth flow

Name the flow precisely: the exact tools that may mint, refresh or rotate, and ideally the agent that may call them, in auth_flow_tools. A healthy declaration is short — often one or two tools owned by a dedicated auth step. If your design has every agent refreshing its own tokens through a shared utility, declare that utility and that utility only. What you must not do is declare every mint-shaped tool 'just in case': a generous auth flow makes the pattern blind in exactly the place it exists to watch. When the design genuinely changes, change the declaration in the same review.

Forge, escape, or both

An undeclared mint_token call outside the allowed-tool set triggers both patterns: it is a tool outside the allowed set (scope escape) and a mint outside the auth flow (token forge). An allowed tool that mints — say a general admin utility on the allowed list, called outside the auth step — triggers the forge alone. Read the pair correctly: the escape tells you the tool boundary failed; the forge tells you new credentials may exist. In review, always chase the forge's products: enumerate tokens minted in the window around the finding and revoke any you cannot attribute to the declared flow.

The no-declaration blind spot

Token-forge detection needs the declaration. With no auth_flow_tools in the scope config, the detector has no legitimate flow to judge minting against. Teams sometimes read a report with no forge findings as comfort when they never declared a flow at all — the honest reading is that minting was not judged. The same applies to scope, egress and privilege: undeclared dimensions are unjudged dimensions. Declaring the flow is a ten-minute task that converts an entire class of silent risk into findings you can act on.

A worked example: Northgate Robotics

Example — fictional operator, illustrative numbers. Northgate Robotics, a fictional warehouse-automation operator, declared 1 auth-flow tool (a dedicated session broker) for its picking agents. A scan of 210,000 actions over 30 days returned 1 token-forge finding: a diagnostics utility calling refresh_token 14 times during a two-day troubleshooting window, outside the broker. The team enumerated the window and found 14 live tokens attributable to those calls; all were revoked, none showed use outside the diagnostics sessions, and the utility lost its refresh capability. The next 30-day scan of 224,000 actions showed 0 forge findings, with the broker handling 100% of mints in the period.

MeasureFigureWhat it showed
Declared auth-flow tools1A dedicated session broker
Actions scanned210,000 over 30 days1 token-forge finding
Undeclared refresh calls14All in one troubleshooting window
Tokens revoked14None used outside the window

See how the plans differ on log size and batch work on the pricing page, and how the detector reads a log in the detector docs.

The checklist: five actions

  1. Declare the flow. Name the exact mint, refresh and rotation tools in auth_flow_tools — a short list, owned by a named step.
  2. Separate minting from doing. Where you can, route all token creation through one broker tool so the declaration stays small and auditable.
  3. Chase the products. For any forge finding, enumerate tokens minted in the window and revoke every one you cannot attribute to the declared flow.
  4. Watch the pair. When forge and scope-escape fire together, fix both the tool boundary and the credential fallout.
  5. Re-declare on design change. Update auth_flow_tools in the same review as any auth redesign — never leave minting undeclared.

Run the free log scan · More agent-security tools from Ingenious AI

Related guides

Auth-Flow Tools in a Scope Declaration: Naming the Minting Path

Scope Escape vs Token Forge: How the Two Findings Differ

How Do You Declare Scope for an AI Agent?

How Long Should You Keep AI Agent Logs? An Audit-Trail Retention Guide

Agent Log Forensics: Finding Credential Grabs After the Fact

What Is Scope Escape in an AI Agent?

Building a Disclosure Packet After an Agent Incident

What to do with a minted token you did not expect

A forge finding leaves a physical residue the other patterns do not: a token may now exist. The response starts with inventory, not argument. From the finding's timestamp and tool, establish what was minted — access token, refresh token, key, assumed role — and whether it was used: search the log after the mint for the token's fingerprint or the calls it would have enabled. A minted-but-unused token gets revoked and the item closes with evidence. A minted-and-used token reopens the whole review at the higher stakes, because every action it authorised inherits the forge.

Revocation has a paper trail of its own. Record the token's identity (never its value), the revocation time and the system that confirmed it, in the worklist. 'We revoked it' is a claim; the identity provider's revocation record is the proof, and the packet should point at it.

Sources

Long-lived tokens deserve their own inventory

Minting findings are about events; the standing risk lives in the stock. Keep an inventory of long-lived tokens and keys the fleet has minted — owner, purpose, mint date, expiry, the agent that holds them — reconciled against the log's minting record at each quarterly review. Tokens in the world but not in the inventory are the forge pattern's slower twin: nobody forged them in a single dramatic action, they simply accumulated outside anyone's account of what exists. You cannot revoke what you cannot list, and the inventory is what turns a future forge finding from an archaeology project into a lookup.

Frequently asked questions

What is a token forge?

A token-minting, refreshing, key-rotating or role-assuming tool — mint_token, refresh_token, create_api_key, assume_role and similar — running outside the declared auth_flow_tools. Severity high.

How is a token forge different from scope escape?

Scope escape is any tool outside the allowed set, severity medium. A forge is specifically about minting new credentials, which persist after the action — so the response includes finding and revoking the tokens created.

Can one action be both?

Yes. An undeclared mint_token call outside the allowed set is both a scope escape and a token forge, and the two findings carry different response duties.

What if I never declared auth_flow_tools?

Then minting was not judged at all — an absence of forge findings in that case is a blind spot, not a clean result. Declare the flow and rescan.

What do I do with tokens a forge created?

Enumerate tokens minted in the window around the finding, revoke any you cannot attribute to the declared auth flow, and record the revocations on the incident worklist.