Applications and SDKs

An application keeps sending the same requests to its model API; only the base URL changes to the Protector. The Protector picks a backend for each request, runs that backend’s guardrail policy and forwards the call.

In the portal: Integrations → Secure60 Protector → Backends

Point the SDK at the Protector

Change the SDK’s base URL to the Protector. A request reaches the Protector’s default backend with no path change, or a named backend at /proxy/<backend>/:

https://<protector-host>                      # the default backend
https://<protector-host>/proxy/<backend>      # a named backend
http://<protector-host>:80                    # inside a private network

The Protector starts with a self-signed certificate. Trust it, give it your own certificate or let it get one with ACME: see Certificates.

Backends

A backend is the destination of a route. Requests reach it at /proxy/<value>/… or with the X-S60-Backend: <value> header, and the rest of the path is forwarded unchanged.

Integrations with Backends selected: a synthetic-response test model and a proxy backend to api.anthropic.com, with value, route, type, upstream host and application

The panel sets the type (proxy to an upstream, an audit-only tap, or a synthetic test response), the upstream URL and timeout, the application name every audit event will carry, the headers to forward and the headers to inject — with the key as {{NAME}} resolved from the container’s environment — how the end user and the session are identified, and the guardrail policy that guards it.

The Backend edit panel: name, value, type, upstream URL, application name and AI provider

The backend’s AI provider is normally detected from the upstream URL; set it explicitly when the URL doesn’t identify the provider, such as a proxy or a custom domain in front of the real endpoint.

Calling this backend at the bottom of the panel shows the route for the SDK and a ready-made curl.

The lower part of the Backend panel: the end of the identity settings, Calling this backend with the route and a curl example, and the guardrail policy selector

Who the caller is, and how sessions are grouped, is set on the same panel: see Identity.

Routing

Your application OpenAI / Anthropic SDK, base URL → the protector POST /proxy/<backend>/v1/… Protector group: prod-gateway picks the backend by 1. /proxy/<value>/… 2. X-S60-Backend: <value> runs that backend's policy on the prompt, then again on the reply audit rows → your project heartbeat → Protectors list support-bot proxy → api.anthropic.com dev-copilot proxy → llm.internal:8080 shadow-tap blackhole — audit only strict-pii protect · mask PII · block secrets observe monitor everything · summary

BACKENDS — where a route goes GUARDRAIL POLICIES — what is checked

One protector, many backends. Each backend has exactly one policy; a policy can guard many backends; a backend can be listed by several protectors. The rest of the path after /proxy/<value>/ is sent upstream unchanged, so the SDK only needs its base URL pointed at the protector. A blackhole backend is an audit-only tap: send it a copy of the traffic and nothing is forwarded — pair it with a monitor policy so it never refuses a call.

One protector (a PROTECTOR_GROUP) routes to any number of backends; each backend is guarded by exactly one policy; a policy can guard many backends, and a backend can be listed under several protectors. The protector picks the backend from the request:

  1. Header override — X-S60-Backend: <backend value> takes precedence over the other rules.
  2. Path prefix — POST https://<protector>/proxy/<backend value>/v1/messages: the segment after /proxy/ names the backend, and the rest of the path is sent upstream unchanged. An SDK only needs its base URL changed to https://<protector>/proxy/<backend>.
  3. Port — a protector.conf can also map listening ports to backends (file-only).
  4. Default backend — anything the rules above did not route goes to the protector’s default backend. With a single backend, an SDK pointed at https://<protector> with no path change reaches it: /v1/messages is forwarded to the default backend’s /v1/messages. The portal sets the default to the first backend added; it can be changed on the Protector.

A request that no rule routes receives a JSON 404 listing the configured backends, and is recorded in the audit trail (outcome: failure, event_result: no_route) so a misconfigured client is visible on AI → AI Activity.

Three kinds of backend, chosen per route:

Type What happens Use it for
proxy Guardrails run, the call is forwarded to the URL, the reply is guarded on the way back Production: the protector is in the request path
blackhole Audit-only tap. Guardrails run and the audit rows are written; nothing is forwarded; the caller gets a synthetic reply Send a copy of your AI traffic here to get the audit trail and detections without the protector in the path. Pair it with a monitor policy so the tap never refuses a call
synthetic-response Returns the configured template Testing routing and policies without a model

Keys. A backend can hold the upstream API key ({{ANTHROPIC_API_KEY}} in its inject headers, resolved from the container’s environment). By default that key is a fallback: a caller that sends its own key has it forwarded untouched, and the stored key is only injected for callers that sent none — so bring-your-own-key applications need no change. Set the backend’s inject mode to always to replace the caller’s key. Per-application client keys issued by the portal are planned for a later release; until then the protector should be reachable only from the applications it serves.

Try it

Send one call through the Protector and read the decision headers. For an Anthropic backend:

curl -sk https://<protector>/proxy/<backend>/v1/messages \
  -H "Content-Type: application/json" -H "anthropic-version: 2023-06-01" \
  -H "x-api-key: $ANTHROPIC_API_KEY" -H "X-S60-User: jane@example.com" \
  -d '{"model":"claude-haiku-4-5","max_tokens":50,"messages":[{"role":"user","content":"Hello Secure60"}]}' -D-

For an OpenAI-compatible backend:

curl -sk https://<protector>/proxy/<backend>/v1/chat/completions \
  -H "Content-Type: application/json" -H "Authorization: Bearer $OPENAI_API_KEY" \
  -d '{"model":"gpt-4","messages":[{"role":"user","content":"Hello Secure60"}]}' -D-

The response carries x-s60-decision and x-s60-enforcement-mode, and the call appears on AI → AI Activity → AI Audit Trail within a minute. To route the same request to another backend, add -H "X-S60-Backend: <other backend>".

To see a guardrail act, send a prompt that holds a test credential such as AKIAIOSFODNN7EXAMPLE. With the policy in Protect, the Protector refuses the call with 403 and x-s60-decision: blocked, and the model is not called. In Monitor, the call goes through and the audit row records the block that Protect would have made.

Errors from the model service

When the model service returns an error, the application receives that error unchanged: the same status (for example 401 for a bad key, 429 for a rate limit, 529 for an overload), the same body and the same retry-after and rate-limit headers. The SDK reports the error and retries as it does without the Protector. The audit row records the call with outcome: failure. If the Protector cannot reach the model service, it answers 502.

A guardrail refusal is different: it is a 403 with x-s60-decision: blocked, recorded with outcome: blocked.

Read-only calls

GET requests, such as GET /v1/models to list the models, go to the model service with the backend’s headers and return its answer unchanged. They hold no prompt, so no guardrail runs; the audit trail records them as allowed calls. A blackhole or synthetic-response backend answers a GET with 405.

Error pass-through and read-only calls need Protector 1.18.4 or later.

Back to top