Product · BetterSign API Delegate · preview
AI agents, scripts and build jobs need to call the APIs of services you use. Instead of handing over an API key, sign in with BetterSign, tick exactly which API calls the agent may make and for how long, and give it a short-lived token. It never sees your credential, every call it makes is checked and logged, and one click cuts it off.
The owner signs in with a BetterSign passkey, connects an upstream API over OAuth 2.0, and issues a grant bound to their VLAD. The agent sends each call to the broker with a bearer token. The broker checks the grant live, attaches the owner’s credential, makes the call and audits it. The upstream credential never leaves the broker.
The agent gets permission to ask. Your credential never leaves.
API Delegate is live at delegate.bettersign.ing, with the Rocket.Chat API as the first one you can connect. Support for any API that uses standard OAuth 2.0 is next. Want it for an API you use? Tell us which.
Benefits
An API key or password does everything you can do, for as long as it lives, wherever it ends up. A delegate token is different on every count.
The agent holds a token that only works through API Delegate, only for what you allowed, and only until it expires. Your real password or key stays put.
The upstream credential stays in the broker, encrypted under a Worker secret. A leaked bsd_ token is useless outside its grant, and tokens are stored only as hashes.
Pick readable permissions such as “post messages” or “create channels”, and limit them to certain rooms. Anything else is refused.
Deny by default. Scopes map to method and path patterns; constraints (for example a room list, plus rooms the grant creates) run after the scope match.
Revoke a token, or all of them, and the agent is cut off on its very next call. Tokens also expire on their own, anywhere from minutes to a week, as you choose.
Each owner’s grants live in a single strongly consistent Durable Object, read on every call with no caching, so a revoke is seen by the next request.
See every call an agent made under each token, allowed or refused, with the time and the result. Kept 30 days by default; you choose how long.
Audit records hold time, grant, method, normalised path, matched scope, decision, upstream status and sizes. No bodies. A daily alarm trims past the retention window.
You sign in with BetterSign, not a new password, so every grant belongs to your identity and nobody else can see or change it.
Sign-in is OIDC against bs-id (PKCE, nonce, ES256 id_token). The owner is the VLAD in the id_token; storage is isolated per owner.
API Delegate connects to a service the same way any app you authorise does, so there’s nothing to install there, and you can disconnect it from either side.
Connectors use standard OAuth 2.0 for the owner’s upstream credential. Expired access tokens are refreshed and the call retried once.
The agent calls the service’s normal API. Only the address and the token change, so any AI agent, script or build job that talks to an API can use it.
Pass-through form /h/{host}/{path} or an envelope POST /v1/call. GET /v1/grant tells the agent what it may do.
When API Delegate turns a call down, the agent is told why, including which permission it would need, so you can widen the grant on purpose, not by accident.
Broker errors carry X-Delegate-Error: out_of_scope (with needs), host_not_granted, constraint_failed, invalid_path, rate_limited, and more.
How it works
You connect a service’s API once. After that, each grant is a few ticks and an expiry, and the token is shown to you once to copy to the agent.
Every agent call follows one checking path: token → grant (live) → host → normalised path → never-grantable list → scope → constraints → rate and size limits. Only allow-listed headers are forwarded, redirects aren’t followed, and Set-Cookie is dropped from responses.
Sign in at delegate.bettersign.ing with BetterSign, by scanning a code with your phone or with one tap from a paired browser.
Connect a service’s API. It asks you to authorise “BetterSign Delegate”, just like any other app.
Create a grant: a label, the permissions, any limits, and an expiry. Copy the token, which is shown only once.
Give the token to the agent. It calls the service through API Delegate, and you can watch or revoke at any time.
Who holds what
The agent never sees the service’s credential, so there’s nothing for it to copy, leak, or keep after you revoke.
Safety
Calls run with your account’s rights, so the fences matter. These hold on every call, whatever the agent asks.
| If the agent tries to… | What API Delegate does |
|---|---|
| Call something you didn’t tick | Refuses it and logs the refusal. Nothing is allowed unless a permission you granted matches. |
| Mint its own password or key, or change users, roles or settings | Refuses it, even if a permission seems to match. Those calls can never be granted. |
| Reach a different site, or a server inside your network | Refuses it. A token only works for the service named in its grant, and redirects aren’t followed. |
| Disguise a call with path tricks | Refuses anything ambiguous, and sends the service exactly the path it checked. |
| Keep going after you revoke | Refuses the very next call. There’s no cached permission to outlive the revoke. |
| Use another person’s connection | Can’t. Each person’s connections and grants are stored separately, and grants only reach their owner’s own. |
| Flood the service | Rate- and size-limits each grant. |
Use the service’s own API, with API Delegate’s address in front and the token as the bearer.
# what this token may do
curl -s https://delegate.bettersign.ing/v1/grant -H "Authorization: Bearer $TOKEN"
# a normal Rocket.Chat call, through API Delegate
curl -s https://delegate.bettersign.ing/h/rocket.bettersign.ing/api/v1/chat.postMessage \
-H "Authorization: Bearer $TOKEN" -H "content-type: application/json" \
-d '{"channel":"#general","text":"hello"}'
Questions
It’s in preview at delegate.bettersign.ing. Anyone with a BetterSign identity can sign in. Rocket.Chat is the first service you can connect; tell us which you’d like next.
Yours. You’re lending your own access, so calls show up on the service as you. That’s why API Delegate checks every call against what you ticked, and why some calls, like creating keys or changing users and settings, can never be granted.
It only works through API Delegate, only for the permissions and service in its grant, and only until it expires. Revoke it and it stops working on the next call. The service’s real credential was never in the agent’s hands.
It holds your connections to services, encrypted. That’s why it connects through each service’s own authorisation, which you can revoke from the service’s side, and why disconnecting is one click. Tokens are stored only as hashes.
It checks where each call goes and what kind of call it is. The call log keeps the time, the call, the decision and the result, never the message or file contents.
No. API Delegate is only for APIs: the agent makes calls to a service’s API through it, the same calls it would make with an API key. It doesn’t fill in login forms, drive a browser, or hand out passwords. The service needs an API that supports OAuth 2.0.
Credential Vault fills your saved logins into your own browser, approved on your phone each time. API Delegate is for software acting on your behalf, only through a service’s API, within limits you set in advance. Both follow the same rule: whatever asks never holds the secret.
Try the preview with the Rocket.Chat API, or tell us which API you’d like to delegate next.