/agents/<name> and handles its grants,
limits and tokens. The agent itself (the model, the conversation, voice) runs
in your own host.
Three things take part:
- An agent is code. It names the resource type one session acts for, the role a session holds, and its tools.
- A credential is a key that can only start sessions. It reads no data.
- A session is one conversation. It holds the agent’s role on one object, such as one customer, until it expires.
bijection/mcp directly instead when your app writes its own access
rules: agents need an access model.
Declaring an agent
Give the agent a role, and give its credentials a role whose only business permission is the power to grant that role:bijection/access.ts
see covers a customer’s identifier alone, so a credential can tell that a
customer exists and reads none of its fields. The agent’s role has no
read.risk, so the fields behind it never reach the agent. maxDuration is
the longest a session can last.
Then declare the agent and export the module:
bijection/agents.ts
module:export path, the definition itself
and the description the model reads. A tool must be a public query or
operation with explicit validators: publishing it adds
a description, never a way in.
Keep the default export in bijection/agents.ts. To export it from another
file, pass that file’s path as module to agentsModule and to
agentOperationPolicy.
Add the tables and the operation policy to your schema, and mount the routes:
bijection/schema.ts
bijection/http.ts
operations: { reads, decide } to
agentsModule to decide for them.
Reading the session in a tool
A query learns whom the agent acts for from the session, so the model never names a customer:bijection/support.ts
Seeing what an agent may do
bijection agent try starts the same kind of session and lists its tools or
calls one, exactly as an agent host would.
Creating a credential
support.voice-prod.agentkey. Bijection keeps no copy. Store
the file’s one line as a secret in your backend, then delete the file.
A credential belongs to one deployment. Create one for each of development,
staging and production.
Use --on <key> when the credential’s role is granted on one object, such as
one organization, rather than on the whole deployment.
To revoke a credential:
Starting a session
In your backend, after you have verified who is calling, start a session and hand the agent’s host its endpoint and token:evidence and does not check it: only a credential
holder can start a session, and you decide when a caller is verified.
A session never changes whom it acts for. Before you know who is calling,
start a session with actsFor: null: it holds no grant and only the tools in
beforeVerification. Once the caller is verified, start another session.
bijection/agents/node runs in your own Node.js process. Don’t import it from
your bijection/ folder.
Call session.end() when the conversation ends. Otherwise the session ends
when it expires.
What a session can and cannot do
- It may call the tools it was offered when it started. A tool you add later reaches new sessions only.
- It may read and change what its role permits on its one object. Anything else is refused, through the endpoint or through your app’s API.
- It is never a person: it cannot approve, grant permissions, delegate, or take any decision that names who decided.
- Its requests are limited each minute by
limits.
tool_changed for that session.
When a tool call reads something the session may not, such as another
customer’s record, the request fails as a whole rather than returning a tool
error.
Watching and closing sessions
Limits
- Agents need an access model whose grants name identities directly. A model
that declares a
usersdirectory is not supported yet. - A session cannot start on an object under a tenant restriction or a marking.
- Up to 16 agents in a module, 32 tools in an agent and 24 credentials in a deployment.
- An agent cannot keep working for a signed-in person after that person’s own session ends.