Credential proxy

clavitor-proxy lets an AI agent call HTTPS APIs without ever seeing the secret: running locally on 127.0.0.1:1983, it fetches the encrypted credential from your vault, decrypts it in memory for one TLS 1.3 request, and injects it into the outgoing header so the agent's prompts, memory and logs only ever hold a clavitor:// reference. Every plan includes the proxy (Free: 1 agent, 10 entries; paid plans: 3 agents per user, unlimited entries).

1. Create the agent's client

Create one scoped client per proxy as in Agent setup, because every request through the proxy counts against that client's scopes, IP allow-list and read quota (default 3 distinct entries per minute, 10 per hour) and appears under its name in the audit log. To keep two agents apart, run one proxy for each, each enrolled as its own client.

2. Install and enroll

Download the single clavitor-proxy binary from Downloads, put it in a directory owned by the proxy user, and run clavitor-proxy init to write an owner-only clavitor.conf beside the binary (the proxy refuses to start if anyone else can read that file):

$ clavitor-proxy init

init reads the client's blob and key from standard input, never from the command line, and shows the vault's hosts, the home vault and its replica, so you can confirm both are yours before anything is saved. There is no setting to move clavitor.conf.

For a scripted enrollment, set CLAVITOR_PROXY_CONFIRM_VAULT to the vault host you expect, or to home,replica when the blob names a replica. init then refuses a blob that names a different vault.

3. Trust the proxy's certificate

Print the proxy's local CA with clavitor-proxy ca and add it to the agent's HTTP trust store so the proxy can terminate and re-encrypt outbound calls over TLS 1.3 (it sends a credential only to sites chaining to your system's or Mozilla's trusted roots):

$ clavitor-proxy ca

4. Start it and point the agent at it

Run clavitor-proxy serve (binds to 127.0.0.1:1983 only by default) and set HTTPS_PROXY with the local proxy-auth token so no other user on the machine can borrow the proxy:

$ clavitor-proxy serve
$ export HTTPS_PROXY="http://clavitor:$(cat proxy-auth)@127.0.0.1:1983"

Every connection must carry the access token from the proxy-auth file next to the binary, and a connection without it is refused. Change the port with CLAVITOR_PROXY_PORT.

The proxy listens only on loopback unless you set CLAVITOR_PROXY_LISTEN to another address and also create an empty file named proxy-allow-private next to the binary, readable only by its owner. The access token travels unencrypted on that port, so do this only on a trusted private network, such as a VPN or Tailscale.

How a credential gets into a request

The proxy injects a credential only when the target host matches one of the entry's listed web addresses, using either an explicit clavitor://<entry title>/<field label> reference in a header or automatic host matching against standard field labels (key, api_key, token, x-api-key, or username + password) — and it never forwards an unresolved reference or reads Identity-encrypted fields.

With a reference. Put clavitor://<entry title>/<field label> in a request header, for example Authorization: Bearer clavitor://OpenAI/key. References are written as for render: the title matches one entry exactly, ignoring case, and a space is written %20. The proxy replaces the reference with the field's value.

By host. With no reference in the request, the proxy looks for the one entry whose web address matches the host the agent is calling, and fills a standard header from that entry's field labels:

Field labelHeader the proxy sets
key, apikey, api_key, token, secret, bearer, access_tokenAuthorization: Bearer <value>
x-api-key, api-keyX-API-Key: <value>
username and password togetherAuthorization: Basic …

Either way, a credential only goes to a host its entry lists among its web addresses: the same host, or its subdomains only where the address says *.. An entry without a web address can't be used through the proxy. When a lookup fails, the request stops with an error. The proxy never sends it on without the credential, and never forwards the reference itself. A request with no reference, to a host no entry matches, passes through unchanged.

Fields protected by Identity Encryption can't be reached through the proxy: only your hardware key opens them.

Cookies an API sets are removed from its responses, so an upstream can't plant cookies in the agent's HTTP client.

Private networks

By default the proxy won't connect to private addresses, loopback, link-local addresses or cloud metadata services, so a manipulated agent can't use it to reach your internal network. If an agent legitimately calls an API on a private network, create the owner-only proxy-allow-private file next to the binary. It is a file, not an environment variable, so it can't be switched on by accident.

Errors

Every proxy refusal carries a stable CV-50xx error code you can match in alerts and scripts (CV-5001–5019 setup, CV-5030–5049 references, CV-5050–5069 host matching, CV-5070–5089 upstream connection).

CodeMeaning
CV-5032No entry has the title in the reference.
CV-5033More than one entry has that title.
CV-5034The entry has no field with that label.
CV-5035The field is protected by Identity Encryption, which the proxy never reads.
CV-5037The host the agent is calling isn't among the entry's web addresses.
CV-5040A header mixes a clavitor:// reference with bytes that aren't valid UTF-8, so the proxy refuses it.
CV-5051More than one entry matches the host. Use a reference instead.
CV-5052The matching entry has no field label from the table above.

What it doesn't protect against

The proxy keeps secrets out of the agent process, but cannot defend against a root-compromised host or an upstream API that echoes credentials back in its response.

  • A compromised machine. The proxy runs beside the agent. Someone with administrator access to that machine can read its memory. The proxy keeps credentials out of the agent, not out of a machine that is no longer yours.
  • An API that echoes the credential back. The proxy puts credentials into requests and doesn't filter responses, so an endpoint that returns the key it was sent hands it to the agent.

What it never logs

The proxy logs only the connection host — plus the error code and path when a request fails — and never logs credential values, query strings, request or response bodies, clavitor.conf or proxy-auth.

clavitor-proxy version shows the version and whether it runs in FIPS mode.