Why gateway-native
Every model call your company makes already passes through the gateway. The gateway knows which key made the call, which team and organization it belongs to, which guardrails apply, how much budget is left and whether the request may be retained. Spanway builds its agent, workflow, eval and compliance features inside that same gateway instead of beside it. Because of that, each feature inherits the controls you already set up, and nothing needs to be wired together twice.
A real-world scenario
A company runs a support agent, a nightly reporting workflow and a dozen internal applications against four model providers. Before the gateway, each system held its own provider keys, had its own idea of a budget and logged to its own place, so the finance team could not say what the agent cost last month and the security team could not say which prompts had left the building. After moving everything behind the gateway, each system calls one base URL with its own virtual key. The agent, the workflow steps and the applications are priced into one spend ledger, the same guardrails screen every call, and one audit log records who changed what. When a key leaks, blocking it stops every system that used it at once.
What the gateway adds
When a feature lives inside the gateway, every call it makes is an ordinary gateway call. That gives you five things for free.
| Shared piece | What it means in practice |
|---|---|
| One key | Agents, workflow steps, evals and coding tools call models and MCP tools with a Spanway virtual key. The provider credentials stay on the gateway, and revoking or blocking the key stops everything that uses it. |
| One policy | Model access, MCP access, rate limits, data policies and custom roles are set once on the key, team or organization and apply to every surface. |
| One spend ledger | Every call is priced and written to the same spend logs, so cost tracking, team budgets and the run ledger see agent, workflow and eval spend next to application traffic. |
| The same guardrails | The guardrails attached to the key, the team and the gateway run on the calls these features make, not only on calls from your applications. |
| One audit trail | Changes made through any of these features are written to the same audit log, with the person who made them. |
The sections below take each capability in turn. Each one says what it is, gives a short example, names its edition and says what being inside the gateway adds. Free means it works without a license. Enterprise means it needs a Spanway license, and the named feature is the one listed on the Enterprise page.
Code context graph for agents
The code graph indexes the Python, TypeScript, Java, Go and C# repositories you connect on GitHub or GitLab, including gitlab.com and self-managed GitLab and serves them to coding agents as the spanway_code MCP server. Agents can find a symbol, read it with its parent and members, outline a file and walk callers and callees instead of reading whole files.
Example. A coding agent asks for every caller of a payment function and reads only those functions, instead of loading the whole repository into its context.
Edition. Enterprise, with the code_graph license feature.
What the gateway adds. spanway_code is registered like any other MCP server, so a key needs it in its MCP grant to see the tools, and per key tool permissions and MCP guardrails apply to it. A call only sees the repositories its key, team and organization may read, and the tool call is logged without the code itself. The gateway never builds or runs your code.
Durable workflows
Workflow runs give an agent or an automation a place to keep state that outlives a single request. The workflow runner runs a workflow's steps against your A2A agents and custom agents, in order or as a graph, with per step budgets, timeouts, retries, dead letters and resume. Triggers start runs from a schedule, a webhook, a chat or a form. Human approval pauses a step or a tool call until the right people approve it. Environments export the workflows, agents and policies people build in one gateway to your own Git repository and promote them to another gateway after review.
Example. Every weekday morning a trigger starts a workflow that summarizes open incidents with an agent, then waits for an on-call engineer to approve before it posts the summary.
Edition. Enterprise. The runner and run storage need workflow_runner, and triggers, approvals and environments need workflow_triggers, human_approval and environments. Retries, history, sub-workflows, saved definitions, templates and queue workers have their own features too.
What the gateway adds. Each step calls agents through the gateway, so the step budget and the run budget are checked against real gateway spend, the agents' own limits and the kill switch apply, and a halted agent stops the steps that use it. Approval decisions are audited as the person who made them. The run ledger shows a run's requests, MCP calls, guardrail decisions and spend in one place.
Evals and red teaming
Evals score models, prompts and agents against datasets you build, copy from logs or generate from pasted documents, on demand, on a schedule or from CI. Red teaming sends attack prompts at a target and reports a pass rate by vulnerability and by attack.
Example. Before switching a support assistant to a cheaper model, you run last week's real questions against both models and compare the scores side by side.
Edition. Enterprise, with the evals license feature.
What the gateway adds. Every model call an eval makes goes through the gateway's own router as the caller. The caller's key and team budgets are checked before each call, the guardrails attached to the key, the team and the gateway apply, and output guardrails check the answer. A red team attack that a guardrail blocks is recorded as defended, so the pass rate shows the protection your guardrails really add. Judge calls carry the data policy of the request they score, so a request that required zero data retention is never judged by a deployment that retains data. Eval spend shows up in usage like any other traffic.
Agent governance
An agent registered with the gateway is a first class caller. Agent governance adds per session limits, required trace ids, binding an agent to an identity provider application, and a kill switch that stops an agent everywhere at once.
Example. A research agent is capped at a few dollars and a set number of model calls per session, and when it misbehaves an admin presses Stop Agent, which disables the agent and blocks or deletes the keys bound to it.
Edition. Registering agents, their agent cards, calling them over A2A, enabling and disabling them, their overall rate limits and their spend are free. The governance controls need the agent_governance license feature.
What the gateway adds. Keys can be bound to an agent, and the gateway applies the agent's own limits on top of the key's. Because every model and tool call already passes through the gateway, a session limit or the kill switch takes effect on the next call, with nothing to install inside the agent.
Custom agents and the MCP gateway
The MCP gateway lets you register Model Context Protocol servers once and expose their tools to MCP clients and to models. A custom agent is an agent the gateway runs for you. You give it instructions, a model, an optional MCP toolset, optional skills and limits, and the gateway runs the tool loop.
Example. A team registers an internal ticketing MCP server once, then builds a custom agent that reads new tickets and drafts replies, with write tools switched off until a proxy admin turns them on.
Edition. The MCP gateway is free. The hosted admin MCP server needs the admin_mcp license feature. Custom agents need the custom_agents license feature, and using server tools such as web fetch inside them needs agent_server_tools.
What the gateway adds. Upstream MCP credentials stay on the gateway. Every tool call is checked against the calling key and team, screened by guardrails, priced and written to the logs. A custom agent run checks its own budget and the caller's key, team and user budgets before each call, and it respects key and team agent grants and the kill switch. If anyone other than a proxy admin changes what a custom agent does, its write tools are switched off again and the change is in the audit log.
Data policy, zero data retention and what Spanway stores
The data policy lets you record how each deployment's provider retains and uses request data, then require zero data retention or forbid training for a request, a key, a team or a whole organization. The router drops every deployment that does not meet the policy, and refuses the request with a message that names the policy when nothing qualifies. What Spanway stores lists every place the gateway keeps request data. Metadata such as who sent a request, which model served it and what it cost is always kept. Prompts and responses are kept only when every setting that applies allows it, and a new install keeps no content.
Example. A team that handles health records sets require_zdr on its keys, and its requests can only reach deployments you declared as zero data retention, while the gateway stores no prompt or response for them.
Edition. Free.
What the gateway adds. The policy is enforced at routing time for every caller. It applies to agents, workflow steps, custom agent runs and eval judges as well as applications, because they all route through the same gateway. A custom agent run under a zero data retention policy is stored without content.
Sanctions screening
Spanway keeps the OFAC jurisdiction policy and a verified snapshot of the OFAC sanctions lists current. Spanway Cloud screens every tenant against the lists at signup, at billing and whenever a list changes, holds possible matches for a person to review, and blocks confirmed matches. The self-hosted gateway can also refuse requests from restricted regions with the sanctions geofence. See sanctions data and geofencing for what these controls can and cannot do.
Example. A new Cloud workspace whose billing details match a listed party is held for review instead of being provisioned.
Edition. Tenant screening is part of Spanway Cloud and needs the cloud license feature. The geofence is free and needs no license.
What the gateway adds. The gateway checks the screening status of the tenant behind every key, team and user on each request and at sign-in. A held, restricted or blocked tenant gets a 451 on every route, so its traffic never reaches a provider.
Tamper-evident audit log and data subject requests
The audit log records every change an admin or a key makes through the management API, with who made it and the value before and after. Each row carries a hash of the previous row, so the chain can be verified and a removed or edited row shows up. Data subject requests export or erase what the gateway holds about a person across its stores.
Example. An auditor asks who widened a team's model access in March. You filter the audit log by team and month, show the change with its before and after values, and verify the chain to show no row was removed.
Edition. Enterprise. The audit log needs a valid license, and data subject requests need the compliance license feature.
What the gateway adds. Keys, teams, guardrails, agents, workflows, evals and settings all change through the same management API, so one log covers all of them. A data subject request reaches the stores these features own as well, for example workflow triggers a person owns and eval dataset items about them.
How this differs from other kinds of gateways
A plain proxy gateway forwards model requests and manages provider keys. Agents, workflows, evals and audit then live in separate systems, each with its own credentials, its own logs and its own idea of a budget, and someone has to keep them in step.
A hosted model router is a service run by another company that forwards your requests to model providers. Your prompts and responses pass through infrastructure you do not operate.
Spanway runs inside your own infrastructure, or as Spanway Cloud, and puts these capabilities inside the gateway itself. That is why one key, one policy, one spend ledger, the same guardrails and one audit trail cover every model, agent, workflow and eval call. To see the features in the Admin UI, start with using the Admin UI.
See it on your own gateway
The quickest way to see the shared pieces at work is to send one request from an application and one through an agent, then read both from the same places.
-
Create a virtual key for a team in the Admin UI under Virtual Keys, + Create New Key, with a budget and a model allow-list. Or with the API:
curl -X POST http://localhost:4000/key/generate \-H "Authorization: Bearer $SPANWAY_API_KEY" -H "Content-Type: application/json" \-d '{"models": ["claude-sonnet-5-5"], "max_budget": 10, "team_id": "support", "key_alias": "support-agent"}' -
Send an application request with that key:
curl http://localhost:4000/v1/chat/completions \-H "Authorization: Bearer sk-the-new-key" -H "Content-Type: application/json" \-d '{"model": "claude-sonnet-5-5", "messages": [{"role": "user", "content": "Summarise the open incidents."}]}' -
Run an agent or a workflow step with the same key, for example from the Agents page in the Admin UI.
-
Open Usage and Logs in the Admin UI. Both calls appear under the same key and team with their cost, and the Audit logs tab shows the key creation.
Expected result: the application call and the agent call share the key's budget, are both priced in GET /spend/logs, and both were screened by the guardrails attached to the key or team. Blocking the key in Virtual Keys stops both.
Errors
| Status | Where | Meaning | Fix |
|---|---|---|---|
401 Authentication Error, No api key passed in. | any route | The request carried no key or an invalid one. | Send Authorization: Bearer with a virtual key or the master key. |
403 Your Spanway license does not include the '<feature>' feature. | enterprise features such as workflows, evals or the code graph | The gateway has no license or one without that feature. | Contact sales@spanway.ai, or use the free features named above. |
400 Budget has been exceeded | model and agent calls | The key, team or user budget is used up, and agents and workflow steps are refused as well. | Raise the budget in Virtual Keys or Teams, or wait for the budget reset. |
| 400 with the data policy name | model, agent and eval calls | No deployment satisfies the data policy of the key, team or organization. | Register a deployment that meets the policy, or relax the policy. |
Related
- Gateway overview for how one request flows through the gateway.
- Virtual keys for the one key every surface uses.
- Cost tracking for the shared spend ledger.
- Guardrails and audit logs for the shared controls.
- Enterprise features for the license each feature needs.