How Duet Agents stores credentials
Duet Agents’s databases are encrypted at rest. On top of that, Duet Agents encrypts the credentials below with AES-256-GCM before it saves them.
For SSH tunnels, Duet Agents generates the key pair for you. You copy the public key to your server’s
authorized_keys. The private key never leaves DuetAgents. See Databases.
After you save a secret
Duet Agents never sends a saved credential back to your browser, so nobody can view it again, including the person who added it. Where it helps you recognize a key, such as your Models Gateway key, Duet Agents shows a masked version. External database URLs are shown with the password hidden. The same goes for credentials Duet Agents creates and keeps for your coworkers and apps, such as a coworker’s email webhook secret, an app’s server secret and database connection strings. They stay on Duet Agents’s servers and aren’t included when Duet Agents shows you a coworker or an app. To change a credential, you replace it. For example, when you edit a custom API: “Leave all credential fields blank to keep the current values, or fill them all in to replace them.” See Change or rotate a credential.How credentials are used
Duet Agents adds credentials to requests on its own servers, at the moment a coworker or app makes a call:- Integrations and MCP servers. Duet Agents runs the action against the service with the stored sign-in.
- Custom APIs. Duet Agents adds your key or token to the request. Calls that carry credentials must use HTTPS, and Duet Agents blocks requests to internal or private network addresses. It won’t save a custom API whose domain is one (“Domain resolves to an internal or blocked host”). Error responses are scrubbed of secrets before they come back.
- External databases. Duet Agents connects with the stored URL. With Enforce Read Only on, “each query will be executed in a read only transaction”.
What coworkers and app code can see
AI coworkers
- No raw credentials. A coworker’s sandbox can only reach DuetAgents. When it uses a connection, Duet Agents makes the call and adds the credential. The coworker sees the results, never the key.
- Only what you grant. A coworker can’t use any integration, MCP server, custom API or external database until someone grants it access. For integrations and MCP servers you can grant Full access, Read only or Custom (specific actions). Custom APIs are on or off. Coworkers only see custom APIs scoped to Organization (all apps). See Connections.
- Artifacts stay read-only. Artifacts a coworker publishes can only run read-only integration actions, and can only query databases that have Enforce Read Only on. See Artifacts.
- Chats are shared. Everyone who can access a coworker can read its chats. Don’t paste secrets into a chat. Add them as a connection instead.
App code
- No environment variables to manage. There’s no place in Duet Agents to add your own secrets or environment variables to an app. App code calls integrations and custom APIs through Duet Agents, and Duet Agents adds the credentials. See Custom APIs.
- Its own database is set up for you. Duet Agents connects each app to its own database. You don’t handle that connection string.
- Code is visible to editors. Anyone who can edit an app can read its code and its earlier versions. Never write a key or password into app code.
Change or rotate a credential
If you think a key has leaked, revoke it at the service that issued it first, then replace it in DuetAgents.
Best practices
Keep connections private unless the team needs them
Keep connections private unless the team needs them
New integration and MCP accounts are Private (“Only you and the coworkers you grant access to can use this connection.”). The settings dialog that opens right after you connect an integration calls this Restricted. Switch a connection to Organization only for shared team accounts, like the company CRM. Keep personal accounts, like your own inbox, private. See Integrations.
Give coworkers the least access that works
Give coworkers the least access that works
Grant Read only when a coworker only needs to look things up, and Custom when it needs just a few write actions. Give Full access only when the coworker really needs to create, change or delete things.
Use read-only database users
Use read-only database users
Leave Enforce Read Only on for PostgreSQL and MySQL. Better still, connect with a database user that only has read permissions, so a mistake can’t change data even if the setting is turned off. Redshift has no read-only setting, so its user’s permissions are your only safeguard.
Scope custom APIs narrowly
Scope custom APIs narrowly
If only one app needs an API, set its Scope to Specific Apps. Coworkers can’t use it then, because they only see custom APIs scoped to Organization (all apps). Where the service allows it, create a key with only the permissions Duet Agents needs.
Rotate keys regularly
Rotate keys regularly
Replace API keys and database passwords on a schedule, and right away when someone with access leaves or a key may have been exposed.
Keep secrets out of chats, instructions and code
Keep secrets out of chats, instructions and code
Chats, instructions, knowledge and app code can all be read by other people who have access to them. Store credentials only as connections, where Duet Agents encrypts them.
Use an SSH tunnel for databases behind a firewall
Use an SSH tunnel for databases behind a firewall
Connect through a bastion host with a DuetAgents-generated SSH key instead of opening your database to the internet. See Databases.

