Features / Guardrails and app sign-in
Guardrails on your traffic. Sign in with UplinkSwitch for your app.
Blocked patterns, a prompt-injection check and tool allow and deny lists per key or org. Sign in with UplinkSwitch gives your app’s users their own key.
What it does
- Blocked patterns
- Regular expressions that block a request before any model is asked, or flag it with x-uplink-guardrail: flagged.
- Prompt-injection check
- A local detector for override phrasing, role markers and hidden characters in user and tool text. Flag or block.
- Tool allow and deny lists
- Keep agents away from a tool: function names, server tools such as web_fetch, and MCP gateway tools such as github__delete_*.
- Org default, key override
- Set a default for the organization and stricter rules per key; the stricter one applies.
- Sign in with UplinkSwitch
- Your app’s users approve a key in their own account; your app gets that key through OAuth PKCE.
- Budget per app
- The limit your app asks for becomes the key’s prepaid budget, and the user can revoke it any time.
Pricing · live catalog, 2026-11-04
| Request | What happens | Charge |
|---|---|---|
| Request a guardrail blocks | 400 guardrail_blocked, no model asked | Nothing |
| Request it flags or passes | Answered as usual | The model’s price, no guardrail fee |
| App user’s key on Claude Haiku 5.5 | Billed to the user’s own balance | $0.0582 in · $0.1455 out per 1M tokens |
| App user’s key on Claude Sonnet 5.5 | Billed to the user’s own balance | $1.20 in · $3.00 out per 1M tokens |
| App user’s key on DeepSeek V4.1 Flash | Billed to the user’s own balance | $0.06 in · $0.18 out per 1M tokens |
Request example
curl · organization guardrails
curl -X PATCH https://api.uplinkswitch.com/v1/guardrails \
-H "Authorization: Bearer $UPLINK_ADMIN_KEY" \
-H "Content-Type: application/json" \
-d '{
"guardrails": {
"blocked_patterns": [
{"name": "internal-codename", "pattern": "project\\s+bluebird", "action": "block"},
{"name": "ssn", "pattern": "\\b\\d{3}-\\d{2}-\\d{4}\\b", "action": "flag"}
],
"prompt_injection": "flag",
"tool_policy": {"allow": null, "deny": ["web_fetch", "github__delete_*"]}
}
}'curl · stricter on one key
curl -X PATCH https://api.uplinkswitch.com/v1/keys/KEY_ID \
-H "Authorization: Bearer $UPLINK_ADMIN_KEY" \
-H "Content-Type: application/json" \
-d '{"guardrails": {"prompt_injection": "block"}}'JavaScript · start app sign-in
// 1. In your app: make a PKCE pair and send the user to sign in.
const verifier = base64url(crypto.getRandomValues(new Uint8Array(32)));
const challenge = base64url(
new Uint8Array(await crypto.subtle.digest("SHA-256", new TextEncoder().encode(verifier))),
);
location.href =
"https://uplinkswitch.ai/auth" +
"?callback_url=" + encodeURIComponent("https://yourapp.example/callback") +
"&code_challenge=" + challenge +
"&code_challenge_method=S256&key_label=Your%20App&limit=5";
function base64url(bytes) {
return btoa(String.fromCharCode(...bytes)).replace(/\+/g, "-").replace(/\//g, "_").replace(/=+$/, "");
}curl · trade the code for a key
# 2. On your callback: trade ?code= for the user's key. No key needed here.
curl https://api.uplinkswitch.com/v1/auth/keys \
-H "Content-Type: application/json" \
-d '{"code": "CODE_FROM_CALLBACK", "code_verifier": "VERIFIER_FROM_STEP_1", "code_challenge_method": "S256"}'
# => {"key": "sk-uplink-live-...", "key_id": "...", "name": "Your App", "limit_usd": 5}- Guardrail routes take an admin key, created in the console.
POST /v1/auth/keysneeds no key and answers any origin. - A blocked request answers in the caller’s format with the pattern’s
namein the message.
Questions
Three things, each opt-in: blocked patterns (up to 50 regular expressions checked against system, user and tool text, each set to block or flag), a prompt-injection check (off, flag or block), and a tool policy that allows or denies tools by name, server tools and MCP gateway tools included.
It is a local detector, with no model call: known override and jailbreak phrasings, chat-template and role markers inside user or tool text, instructions aimed at the model inside tool results, and invisible Unicode tag characters. It matches wording, so paraphrases, other languages and encoded payloads pass, and text that quotes an attack is flagged like one.
On the organization (PATCH /v1/guardrails) as a default for every key, and on a key (guardrails on POST or PATCH /v1/keys). Both apply, and the stricter one wins. Keys pick up a change within a minute.
Its declaration is removed before the request is forwarded, a tool_choice that forces it is refused, and a call to it in the answer is stripped, with x-uplink-guardrail: tool_call_stripped on the response.
OAuth 2.0 with PKCE (S256) for apps. Your app sends its user to /auth with a callback URL and a code challenge; after the user approves, your callback gets a code, and POST /v1/auth/keys trades it for a new key owned by the user’s organization, named key_label, with limit as its budget. Your app never holds a password or your own key.
https, or http on localhost, 127.0.0.1 or [::1]. Codes are single use and expire 10 minutes after approval. The user sees and can revoke the key under Authorized apps in the console.
More features
Agent tools
Web search, fetch, MCP and code.
Files and redaction
PDFs for every model.
Routing
Auto router, fallbacks, presets.
Caching and context
Repeat answers at a tenth.
MCP gateway
One MCP endpoint
Endpoints
Embeddings, rerank, transcription.
Observability
Every session, request by request.
All features
Every group, with live prices.