# What's next for models

> AI tools reaching their models through the realm, with short-lived credentials and usage counted by user, device and tool; planned, and what to use until then.

These model features are planned. None of them is available yet; each says what to use today.

## Runtime credentials

**What it will do.** A model key left on a laptop works for whoever copies it, for as long as it lives. Instead, the
tools ask the AI tools agent for a credential when they need one, and get a short-lived one for the model gateway; the
provider keys stay at the gateway. A tool that can't ask goes through the [local model proxy](#local-model-proxy).

**How you'll use it.** You'll turn on the gateway in the realm's [managed configuration](../../configuration/whats-next/#managed-configuration);
the agent writes each tool's settings to ask it for credentials, and you take the provider keys off your users'
machines.

**What to use today.** Each tool holds its own provider key.

## Local model proxy

**What it will do.** Run a proxy on the device's loopback address that adds the gateway credential to each call and
forwards it, for tools that can't carry a credential themselves. It forwards only, without inspecting or redacting,
refuses anything that isn't a loopback request from the device's own user, and when it can't run, the policy says
whether the tools that use it fail closed (the default) or fall back.

**How you'll use it.** The managed configuration points those tools at the proxy for you; nothing changes for their
users.

**What to use today.** Tools call their providers directly.

## Gateway tokens

**What it will do.** Issue short-lived signed tokens naming the user, the device and the tool, with published keys to
check them (RFC 7517), so a model gateway can route, apply policy and attribute usage by who is calling. The tool
named in a token is reported by the device: use it for attribution, not as proof of the calling program.

**How you'll use it.** Your model gateway checks each token against the published keys, and reads the user, device
and tool from it.

**What to use today.** A model gateway sees only the provider key a tool sends.

## One gateway for every provider

**What it will do.** Put every major model provider behind one API, so a tool reaches any of them through the same
address and the same credential.

**How you'll use it.** You'll name the providers and models your realm may use, once, at the gateway; tools pick a
model by name.

**What to use today.** Each tool talks to its own provider.

## Model failover

**What it will do.** Balance load across models and providers, and fail over to another when one is unavailable.

**How you'll use it.** You'll list the fallbacks for each model at the gateway.

**What to use today.** Each tool's provider is the only one it reaches; use each provider's own redundancy.

## Usage and cost

**What it will do.** Count each model request's tokens and cost, totaled hourly by user, device, tool, model and
provider, under the realm of the device that made it, and report it only to that realm's administrators. Totals only,
never what was asked.

**How you'll use it.** You'll read it from the fleet's usage report, over the last 24 hours or the last 7, 30 or 90
days, broken down and filtered by user, device, tool, provider or model. The report is already served
(`GET https://foobar.cvyuh.com/api/v0/endpoint/aig/v1/api/v1/usage`; see the [AI Governance API](../../api/#models)),
but nothing feeds it yet, so it's empty.

**What to use today.** Each provider's own usage reports.

## Activity events

**What it will do.** Report each new session and each tool call, from the tools that support it, as they happen, into
the device's `recent_events` in the fleet. Claude Code is the first. Whether a call's inputs (commands, paths) are
included is the policy's choice, off unless you turn it on, since they may hold secrets.

**How you'll use it.** You'll turn activity on in the policy, and read each device's latest events from its fleet
record.

**What to use today.** [AI tool discovery](../../discovery/ai-tool-discovery/) shows which tools are installed, not
what they did.

## Budgets and spend limits

**What it will do.** Set spend limits per realm, agent or team on model traffic, enforced at the gateway.

**How you'll use it.** You'll set a budget, and model calls past it are refused until the next period.

**What to use today.** Set limits with each provider.
