--- url: https://docs.codefox.ai/how-it-works/trust.md --- # Security and trust This page explains the safeguards built into Foxden, from the headers every page sends to the seal on a signed document, so you can judge what Foxden protects and what is left to you. Most of these safeguards are written once in shared code that every app uses, so the apps cannot drift apart. What stays with you is the server itself: who can log in to it, its firewall, and copies of its keys. See [Secure your server](/self-host/secure). ## On the server * **One way in from the internet.** Each app listens on the server's loopback address only. The proxy is the only thing that answers on ports 80 and 443, over HTTPS. * **The updater** has access to Docker so it can replace an app's containers, so it publishes no port, cannot gain new privileges, runs only when its app's settings turn it on, and acts only on requests signed with its app's own updater secret. * **The control service** runs `foxden` commands as root for Admin's console. It has no network at all: it listens on a socket on the server, accepts only requests signed with a key derived from Admin's `APP_SECRET`, refuses a request whose time is more than a minute off or that it has already seen, and runs only operations from a fixed list. Some settings are never changed from the web whatever the request says: secrets, database addresses and passwords, the box key, the updater's secret, where images come from and which build runs, the backup passphrase, where backups are copied, and any value the server runs as a command. You change those with `foxden` on the server. To turn the service off, set `FOXDEN_CONTROL=off` in Admin's settings file. * **The renderer** that prints PDFs runs read-only, with no Linux capabilities, on an internal network with no route off the server, and aborts every request a page makes while it prints except to `data:` addresses. ## Secrets * `foxden init` generates each app's secrets and writes them to the app's settings file, readable by root only. It never puts a secret on a command line. * Each link between two apps has its own secret, so one app's secret opens nothing else. A link between two apps is derived from the box key; each app's link to Admin gets a random secret at install. * Inside an app, each purpose (sessions, invitations, stored tokens, signing keys) gets its own key derived from the app's secret, so a leak of one cannot be used as another. * Admin has no passwords. People sign in with Google, Microsoft or a one-time email link that works once, for ten minutes. A console session lasts 12 hours. See [Where your data lives](/how-it-works/data) for what is encrypted with which key. ## Security headers Every app sends the same response headers, from one shared definition: * `Strict-Transport-Security` for two years, including subdomains. * `X-Frame-Options: DENY` and `frame-ancestors 'none'`, so no other site can show an app's pages in a frame. An app whose pages are meant to be embedded names the sites that may do it instead. * `X-Content-Type-Options: nosniff`. * `Referrer-Policy: strict-origin-when-cross-origin`, or `no-referrer` on pages whose address carries a secret. * `Permissions-Policy` that turns off the camera, microphone and location, except in an app that uses one. ## Activity and audit * **Each app keeps its own activity log**: who did what, to which record, and when. * **Admin shows them together.** Admin reads each app's log a page at a time and keeps a copy under **Workspace** › **Activity**. The copy holds ids and the name of the action, never what a record said, so the people who may read a record are still decided in the app. See [The activity log](/run-your-company/activity). * **Admin logs its own changes**, including every server action: who asked, and how it ended. * **Assistant calls are recorded twice**: by the app that ran the tool, and by Admin under **Workspace** › **Assistants**. * **Corsac keeps a chain per document.** Each event in a document's audit trail is hashed together with the one before it, so an event cannot be changed or removed without breaking the chain, and the chain's latest link is timestamped. ## Signed webhooks and events When Foxden tells another system that something happened (Admin's events, Corsac's webhooks, Pampas's destinations), each delivery: * is signed with HMAC-SHA256 under a secret only you and the sender hold, sent as `sha256=`, with the time inside what is signed where the format has one; * goes only to a public address: a private or local address is refused, the address is looked up once and that answer is used for the connection, and redirects are never followed; * is tried again on failure (for Admin's events: after 30 seconds, 2, 8 and 32 minutes, then hourly, eight attempts in all). Admin's events carry ids and a few facts, never content: no transcript, note, email body, document text or name. A system that needs more reads it through the app with its own credentials, so the app's access rules apply. See [Send events to another system](/connect/events). ## The seal on signed documents When the last signer signs, Corsac seals the document: 1. It stamps the signatures onto the PDF and adds a certificate page. 2. It signs the whole PDF with the server's own seal certificate (RSA-3072, made at Corsac's first start, its private key encrypted under Corsac's `APP_SECRET`). Any change to the PDF afterwards breaks this signature. 3. It adds a trusted timestamp from a timestamp authority (DigiCert, then Sectigo if that fails), which proves when the document was sealed. Only a hash of the document is sent. Anyone can check a sealed document, and Corsac checks timestamps from other authorities too. See [Verify a signed document](/apps/corsac/verify-a-document). ## What an AI assistant can and cannot do * An assistant acts as its person, with that person's level in each app. It cannot do anything its person cannot. * The gateway holds no powers of its own. For each call it makes a token for one app that works once, for at most 60 seconds, and cannot start a session. * An agent identity can only hold **Can use** in an app, and never any level in Admin. * No assistant can give or take away access to Admin itself, even an Owner's. * An Owner can pause a person's assistant, one connection or one tool, set daily limits, and decide whether assistants ask their person before they delete, send or spend. The apps apply a rule within a minute. * Text that comes back from a tool (a meeting, an email, a page) was written by someone else. The gateway tells assistants to report it and never to follow instructions found in it. * An operator can switch off the whole assistant gateway (`MCP_DISABLED`) or all AI (`LLM_GATEWAY_DISABLED`) in Admin's settings file. See [The AI gateway](/connect/gateway) and [Ask before acting](/connect/ask-before-acting). ## Related * [Identity and access](/how-it-works/identity-and-access) * [Secure your server](/self-host/secure)