Self-hosted
Free
- Server, broker and admin panel
- Node and Python SDKs, CLI
- Approvals, budgets, health, audit
- Unlimited capabilities and identities
Grant gives developers, services and coding agents short-lived, revocable leases instead of API keys. The real key stays in an encrypted vault, and Grant adds it to each request on the way out.
Free to self-host. Node and Python SDKs. Works with Claude Code, Cursor, Codex and any tool that reads environment variables.
Commits written with AI assistants leak secrets at twice the usual rate, and more than 24,000 secrets have been found sitting in MCP config files. Source
Coding agents read .env files on their own, because a plaintext key looks like useful context. Source
Keys live for months, carry full permissions and are shared across services. Rotating one tends to break production, so it rarely happens.
gnt_l_x7QmP2
Holds a lease that expires in minutes
sk-proj-8fK2
Only the provider ever sees it
An admin stores the provider key in Grant. It is encrypted with AES-256-GCM and never shown again, not even to the admin.
grant.client("openai") returns the official SDK client. Grant issues a lease for each process and refreshes it before it expires.
Mark live payments or production databases as approval-required. The request waits until a person approves a time window, then the lease cannot outlive it.
End one lease, every lease an agent holds, or every lease on a key. Rotate the key without restarting anything that uses it.
The SDKs return the clients you already use, pointed at Grant. No wrapper API to learn, and nothing to change when a key rotates.
// npm install @grant/sdk openai
import { grant } from "@grant/sdk";
const openai = grant.client("openai"); // self-refreshing, budget-capped
const reply = await openai.chat.completions.create({
model: "gpt-4.1",
messages: [{ role: "user", content: "Hello" }],
});
# pip install grant-sdk openai
import grant
openai = grant.client("openai") # the official OpenAI client
reply = openai.chat.completions.create(
model="gpt-4.1",
messages=[{"role": "user", "content": "Hello"}],
)
balance = grant.request("stripe", "GET", "/v1/balance") # any HTTP API
# The agent gets lease tokens. Your identity token is removed.
$ grant run --cap openai,anthropic -- claude
grant: openai leased (broker, 900s, renewed while running)
grant: anthropic leased (broker, 900s, renewed while running)
# When the session ends, both leases are revoked.
// grant.json, committed with the code and reviewed in pull requests
{
"capabilities": {
"openai": { "intent": "dev" },
"stripe-live": { "reason": "refund flow" }
}
}
$ grant check
ok openai allow
pending stripe-live approval_required
Grant holds the keys, so it is designed to limit damage when any one part is compromised.
| If this happens | What Grant does |
|---|---|
| A prompt injection tells an agent to send its keys somewhere | The agent only has a lease token. It works against Grant, for one provider, for minutes. |
| A lease token leaks into a log or a commit | It expires on its own, and you can revoke it immediately from the admin panel. |
| Someone copies the database | Root keys are encrypted at rest, and each ciphertext is bound to its row. Tokens are stored only as hashes. |
| An agent loops and burns through credits | The daily budget stops it with a clear error before the next request reaches the provider. |
| A key has to be rotated today | Paste the new key. Running clients pick it up on their next request, with no restart. |
Runs on 127.0.0.1 with storage in ~/.grant. Nothing to sign up for and nothing leaves your machine.
The same server behind your TLS, in your cloud. Point the SDKs at it with one environment variable.
Free
Early access
Contact us
Team and Enterprise features are on the roadmap and not yet generally available.
Start the server. It prints an admin token on first run.
npx @grant/serverOpen http://127.0.0.1:7878, add your OpenAI key and create an identity.
Use the identity token instead of the key.
export GRANT_TOKEN=gnt_i_...
grant run --cap openai -- node app.jsNo, not in the default mode. Your process holds a lease token, and Grant adds the key to the outgoing request. If a capability allows it, grant.key() can return the raw key as an escape hatch. That is off by default and is recorded in the audit log.
The SDKs keep using a lease that has not expired yet, and only fail once it has. Denials and revocations are never masked by the cache.
Any HTTP API that authenticates with a header. OpenAI, Anthropic, Stripe and GitHub come preconfigured. For anything else, set the upstream URL and the header format.
Start the agent with grant run. Tools that read OPENAI_BASE_URL and ANTHROPIC_BASE_URL work without changes, and the agent never receives your identity token. Add the Grant MCP server and the agent can also list, request and check access on its own. The MCP tools never return a key.
In a SQLite file on the machine running the server: your laptop in local mode, your own infrastructure in shared mode. Keys are encrypted with a master key that you control.