Skip to Content
RabbitLock Docs

How it works

Placeholders, the local proxy, and the six outcomes of every request.

The flow

rabbitlock run -- <agent> does this before the agent starts:

  1. Loads the policy (rabbitlock.agent.yaml). RabbitLock looks in the current directory and then each parent directory.
  2. Decrypts the secrets file inside RabbitLock's own process, using your identity. If the file's integrity check fails, the run stops.
  3. Creates a placeholder for each secret named in the policy: rl_ph_<NAME>_<128-bit random>, new every session.
  4. Starts a proxy on 127.0.0.1 at a random port.
  5. Launches the agent in a sandbox, with placeholders and proxy settings in its environment, and without any real value or RabbitLock key material.
  agent  ──(placeholder)──▶  RabbitLock proxy  ──(real token)──▶  api.github.com
                                    │
                                    ├─ is this secret allowed on this host?
                                    ├─ does a human need to approve?
                                    └─ write a receipt (never the value)

Placeholders

Tools pass the placeholder around exactly as they would the real token. RabbitLock finds it in:

  • request headers, including inside Authorization: Basic credentials (git over HTTPS)
  • the URL, including query strings (the value is percent-encoded)
  • request bodies: JSON (application/json, *+json), form (application/x-www-form-urlencoded) and text/*. The body must be at most 1 MiB and uncompressed. Each value is escaped for its format (JSON string escaping, URL encoding), and Content-Length is recomputed.

Larger, compressed or multipart bodies pass through untouched, so they can only carry the placeholder.

The six outcomes

For hosts listed in your policy, RabbitLock terminates TLS with a certificate from its local CA, inspects the request, and re-sends it upstream over normally verified TLS. Every request ends one of these ways:

RequestResultReceipt
Placeholder for a secret allowed on this host, approval passesReal value swapped in, forwardedinjected
Placeholder for a secret not allowed on this host403; never leaves your machineblocked_host
Approval required and denied, timed out or unavailable403; never leaves your machinedenied_approval
Placeholder sent over plain HTTP403; secrets are never injected over cleartextblocked_insecure
Host not in your policyTunneled untouched; it can only carry placeholdersnone
No placeholder in the requestForwarded unchangednone

The destination used for both the policy check and the upstream connection is the host the agent actually connected to (the CONNECT target). A forged Host header can't redirect a secret.

What the agent's environment contains

VariableValue
Each secret named in the policyits placeholder
HTTPS_PROXY, HTTP_PROXY (and lowercase)the broker
NODE_USE_ENV_PROXY1
NODE_EXTRA_CA_CERTSthe local CA certificate
SSL_CERT_FILE, REQUESTS_CA_BUNDLE, CURL_CA_BUNDLE, GIT_SSL_CAINFOsystem roots plus the local CA
RABBITLOCK_ACTIVE, RABBITLOCK_SESSION1 and the session id

Removed before launch: every other RABBITLOCK_* variable (including RABBITLOCK_SEED_HEX), and any variable whose value equals a real secret, whatever its name.

On this page