Skip to content

The Nested security model, layer by layer

Sign-in, tokens, teams, secrets at rest, site logins, agent sandboxes, and audit: how Nested protects an install, and the gaps we have not closed yet.

6 min read

Start with the boundary#

The largest security property of Nested is not a feature. It is that the platform runs in your Kubernetes cluster, with your Postgres and your object store, and there is no shared vendor backend holding your data. We wrote about that choice in Why Nested runs inside your cluster.

A boundary is not a security model, though. Inside it, people sign in, agents act on their behalf, credentials move from a settings screen into a running pod, and someone has to be able to answer “who did this?” six weeks later. This post goes through those layers in order, including what is not done yet.

Signing in#

Nested’s auth service is its own identity provider. It supports three sign-in methods:

MethodHow it works
Passkeys (WebAuthn)Discoverable credentials with user verification required, both when you add a passkey and when you sign in. A ceremony expires after 5 minutes, and 10 failures in 15 minutes lock that client out.
GoogleStandard Google sign-in. A new account is created only when Google says the email is verified and either its domain is on the operator’s allowlist or a team invitation for that email is pending. Registration is never open to the public.
PasswordSRP-6a, so the server stores a verifier and never sees or stores the password. Attempts are rate limited. In managed installs, password sign-in is a break-glass fallback that is off unless an operator enables it.

You can add several passkeys from Settings → Profile, and you cannot remove your only way to sign in.

Tokens#

Sessions use RS256-signed JWTs, with public keys published at a JWKS endpoint so every service can verify tokens without calling back.

TokenLifetime
Access token15 minutes
Refresh token7 days
Agent task token15 minutes by default, 1 hour hard cap, no refresh

Refresh tokens rotate: each refresh revokes the old pair and issues a new one in the same family. If a spent refresh token comes back, that usually means it was stolen — so the server revokes the whole family. The one exception is a 60-second grace window, during which a repeat returns the same successor pair. Without it, two browser tabs refreshing at the same moment would sign each other out.

Nested is also an OAuth 2.0 and OpenID Connect server, so other tools can offer “sign in with Nested”. It supports the authorization code flow with PKCE S256 only. Public clients get a consent page that shows which details they asked for. A consent transaction lives 15 minutes and is consumed atomically, and the audit log records the client and the outcome — never the code, state, or redirect query.

Teams and access#

Everything in Nested belongs to a team: agents, tasks, automations, reports, packs, connectors, memories. Members are owners, admins, or members, and team scoping is enforced in each service, backed by a cross-team isolation test suite.

On top of teams, a resource-access layer answers questions like “may this caller submit a task to this agent?” with an explicit reason — allowed as owner, allowed as team member, denied because the agent only accepts tasks from its owner. The same rules cover non-human callers: peer agents, the scheduler, automations, and startup tasks. Named CEL policies gate sensitive actions such as publishing or deleting packs.

A few things are private even from operators. Memories belong to the user who owns them, and operator access to knowledge explicitly excludes memory centers.

Secrets at rest#

Every service that stores a credential encrypts it with AES-256-GCM, a random nonce per value, and its own 32-byte key from your configuration:

WhatEncrypted by
Connector OAuth tokens and credentialsThe connectors service
Cluster connection and registry credentials, user secrets for agentsThe deploy service
Webhook secrets and bot credentialsThe hooks service
Saved website loginsThe site-access service
Git source credentials for packsThe pack service
Notification tokensThe notification service
Environment secretsThe Environments service, with envelope encryption and a rotatable key ring

Secrets you give an agent never appear inline in a manifest. The deploy service renders them into a Kubernetes Secret owned by the agent’s Helm release and wires each one into the pod with secretKeyRef. When you create a secret you choose who can use it — only you, or everyone in the team — and the app only offers secrets you can use.

Passwords the model never sees#

Some work needs a website login: a vendor dashboard, an admin portal. Pasting a password into chat puts it into the model’s context and the runbook. Site logins avoid that. You save a login once and grant it to specific agents. When an agent needs it, a broker in the agent pod types the password into a browser the broker controls, and the agent receives only a status. One-time codes, captchas, and phone approvals are asked of you through a card in the app, never in chat.

Inside the agent pod#

Agent pods run in a user-namespaced sandbox. The default RuntimeClass is Sysbox, which lets an agent run Docker without privileged mode. If your cluster has no Sysbox, deploy falls back to Kata, then to the default runtime, unless you pinned a RuntimeClass, in which case a missing one fails the deploy. So check what your agents actually run on; it is not always Sysbox.

Inside the pod, the coding agent and its terminals run with a deny-by-default environment: only an allowlist (PATH, HOME, LANG, a few more, and whatever the agent’s configuration adds) passes through, and patterns like *_TOKEN, *_SECRET, *_PASSWORD, AWS_*, and DATABASE_* are always stripped. Connector tokens are added by a loopback proxy rather than handed to the session, as we described in the MCP catalog post.

Audit#

The auth service keeps a cross-service audit trail of user actions: who acted (person, agent, or service), the action, the resource, field-level changes, request id, IP address, and user agent. It is stored in monthly Postgres partitions and kept for 90 days by default. You can read your own trail under Settings → Activity. Domain histories, such as every version of a knowledge page, are kept separately by their own services.

What is not done#

We would rather you hear these from us:

  • An agent pod cannot yet keep every secret from the model. If you bind a secret into an agent’s environment for a tool to use, a determined prompt can read it. The environment filter, the token proxy, and site logins are the mitigations we have shipped; they narrow the problem, they do not close it. Bind only what an agent needs.
  • Keys come from configuration. Encryption keys are static keys in your configuration or secret store. There is no KMS or HSM integration, and only Environments has a rotatable key ring.
  • No dynamic client registration for “sign in with Nested” yet. OAuth clients are registered by an operator.
  • Webhook replay protection is mostly deduplication. Slack requests carry a timestamp window; generic, GitHub, and Sentry deliveries are deduplicated by id.

Closing#

Security in Nested is mostly a long list of small, boring decisions: verify the user, scope the token, encrypt the secret, keep it out of the prompt, write it down. The security docs cover how to configure each layer for your install.

Last revised .

Questions

Does Nested support passkeys?
Yes. Nested supports WebAuthn passkeys with user verification required, plus Google sign-in and an SRP password fallback. You add passkeys under Settings → Profile.
How does Nested store secrets?
Each service encrypts credentials at rest with AES-256-GCM and its own key. Secrets you bind to an agent are delivered through a Kubernetes Secret and secretKeyRef, never inline.
Can the agent read my website passwords?
Not with site logins. A broker in the agent pod types the password into its own browser and returns only a status to the agent.
Does Nested have an audit log?
Yes. User actions across services are recorded with actor, action, resource, and field changes, kept 90 days by default. You can view your own under Settings → Activity.