Security

Keep Cruxy keys out of browsers, code, and logs, scope each key to what it needs, keep secrets out of memory, and turn capture off for anonymous traffic.

Most of what keeps a Cruxy integration safe comes down to three things: the key stays on your server, each key can do only what its service needs, and nothing a stranger types ends up in your memory. This page is the list. Get your API key covers key handling in more detail.

Keep the key on your server

  • Never ship a key to a browser or a mobile app. Anyone who can read the code can read the key. Put a server route between your client and the gateway that adds the key; see Streaming chat in the browser.
  • Read it from the environment or a secrets manager, never from source control. Use one key per environment.
  • Log the key_id, never the key. That goes for error reports too: when you contact Support, send the key_id and the request IDs, never the key itself.
  • Send it only to https://api.cruxy.ai.

Check the key kind at startup

A server must run on a developer API key, created in the Cruxy Console, never a signed-in credential from device login. A signed-in credential carries its owner's memory and standing rules into every request by default, and expires. GET /api/v1/limits names the kind in bucket: apikey for a developer key, subscription for a signed-in credential, headless for a key billed from prepaid credit. Refuse to start on the wrong one:

# bucket is apikey for a developer API key.
curl https://api.cruxy.ai/api/v1/limits \
  -H "Authorization: Bearer $CRUXY_API_KEY"

Give each key only what it needs

A key can carry restrictions, and a request outside them is refused:

  • Allowed scopes: the endpoint families the key may call, and whether it may use memory, rules, or files. A key whose scopes omit memory can never read or write anyone's memory through chat, so it is the key to issue for a service that must never see memory.
  • Model allowlist: the tiers the key may call. A request for another tier is 403 model_not_allowed.
  • Monthly spend cap: past it, 429 key_spend_cap_exceeded.

For a developer API key, the Console sets the model allowlist and the spend cap. See Get your API key.

Rotate and revoke

Rotate or revoke a developer API key in the Console. A signed-in credential cannot be rotated, but its holder can revoke it with DELETE /api/v1/me/key, sent with that key: do it on sign-out, and at once if it leaks. If you no longer hold the key, email [email protected] to have it revoked. It otherwise stays valid until its expires_at. See Revoke the current key.

Never put secrets in memory

Memory has no expiry. A stored value stays, and recall can place it in later turns, until someone deletes it. The capture filter drops content that carries an email address, a phone number, or a card number; it does not promise to catch a password, an API key, or a token.

  • Never send a secret in a turn that captures, and never store one by hand with PUT /api/v1/memories.
  • Review what is stored with GET /api/v1/memories, and remove an entry with DELETE /api/v1/memories/{id}.

See Memory.

Turn capture off for anonymous traffic

On any request that serves people other than the key's owner, such as a public chat box or a support widget, send:

{ "memory": { "recall": false, "capture": false }, "rules": false }

With capture on, the gateway stores what strangers say into the key owner's memory; with recall on, the owner's stored memory can surface in a stranger's answer. A developer API key has both off by default, but send them on every request anyway, so a key swapped by mistake cannot turn them on. Pin Cruxy-Version 2026-09-26 or later when you rely on false: a gateway that predates the field would ignore it and capture anyway.

rules: false matters here too. A model can repeat an injected standing rule to anyone who asks for it. Before you opt a public-facing key into rules, read GET /api/v1/rules/resolved and confirm nothing in it is meant to stay internal. See Standing rules.

Screen untrusted input

To classify user text before it reaches chat, send it to POST /api/v1/moderations with the cruxy-guard model, and decide in your own code what to block. Moderation gate builds that gate.

Next steps

Was this page helpful?