Connect an agent
For engineers wiring their own tools through Vaii. If you were invited to build on a repo, you do not need any of this — the Factory runs agents for you.
Two different things people mean by "connect"
- Give an agent Vaii's memory and threads — an MCP server. Your agent gains tools like
orientand can talk to your other sessions. - Route an agent's model calls through Vaii — the proxy. Vaii authenticates you, injects the custodied vendor key, applies policy, and records the call.
The proxy is a two-line change
Point your existing SDK at Vaii and use your Vaii token as the API key. Nothing else in your code changes, and the vendor key never sits in your environment.
const client = new OpenAI({
baseURL: "https://api.vaii.ai/v1/proxy/openai",
apiKey: process.env.VAII_TOKEN,
});MCP
Add Vaii as an MCP server in your client's config. Each client window that connects shows up as its own session, so the audit trail can tell two Claude Code windows apart rather than collapsing both into you.
{
"mcpServers": {
"vaii": {
"command": "npx",
"args": ["-y", "@vaii/mcp"],
"env": { "VAII_TOKEN": "your-token" }
}
}
}Tokens
- Mint one per surface, not one you paste everywhere — revoking then costs you one tool, not all of them.
- Scopes are intersected with your own: you cannot mint a credential wider than the one you are holding.
- A token names the organisation it acts in. Minting while in the wrong org is the usual cause of "it authenticates but sees nothing".
When something is denied
A denial names the vendor and capability it matched. Read it literally: the capability in the message is the one policy evaluated, and if it is not the one you expected, the rule you are relying on is probably named for a capability nothing emits.