Secrets
A secret is a named credential — an API key, token, or connection string — stored in Swan:- Org secrets are usable by every user and trigger in the org.
- Personal secrets are usable only by you. A personal secret with the same name as an org secret overrides it for your runs.
${secret.STRIPE_API_KEY} — and the real value is injected only at execution time, inside the sandbox. It never appears in the conversation, and code that would leak a resolved value into an output file is blocked automatically.
One rule on your side: don’t paste keys into chat. If you do, Swan is instructed to have you add the key at Settings → Secrets instead and delete the message — a value pasted in chat lives in the conversation history; a secret doesn’t.
How Swan works with an API
Ask for what you want in plain language — “pull our open invoices from our billing system, the key is stored asBILLING_API_KEY”. Swan then works the way a careful engineer would:
- Reads the docs first. It researches the official API reference for the exact endpoints it needs — auth format, parameters, pagination, rate limits — rather than guessing from memory.
- Validates step by step. First a cheap authenticated check, then a single read, then — only if the task requires writing — a single write, confirming with you before the first write to a production system. Only then does it scale up to the full job.
- Handles failures diagnosably. Non-success responses are surfaced with their status and cause, so a bad key, a permissions gap, or a wrong endpoint gets fixed rather than retried blindly.