Where Your Keys Live: Credentials and Access Boundaries
Week two of a pilot. The security reviewer has CloudThinker's AWS role open in the IAM console and three questions in the review doc. What can it touch? Where does the key live? And when something changes, how would we know who did it?
Those are the right questions, in the right order. An agent that investigates production needs real access: a cloud account, a cluster, a Git organization, a monitoring tool. For Frontier Investigation Agents, the short answers are these. The credential you create is the ceiling. The value is stored encrypted and injected where a command runs, never into the model's context or onto your laptop. And every action leaves a record in three places. Those three answers are the core of CloudThinker's security model.
Why the usual approach breaks
Most teams give an AI tool access the way they give a script access. Paste a token into the chat. Export a key in a shell. Leave a long-lived credential on a CI runner.
Each of those moves the secret somewhere you can't see: a chat transcript, shell history, a disk nobody patches. The tool's reach becomes whatever that token allows, which nobody wrote down. And when it acts, your cloud provider logs a call from a role. It doesn't say which conversation asked for the call, who approved it, or whether a person was involved at all.
We wanted the opposite. Access declared in one place, scoped by you at the provider, never copied onto the machine doing the work, and recorded with the agent named as the actor.
What it can touch: the credential is the ceiling
A connection is a saved credential for one external service. Its permissions at the provider are the ceiling: if the IAM role can't delete a bucket, no prompt, Rule or approval can make an agent delete one.
AWS shows what that looks like. The connect dialog generates an External ID, and a setup script you run in CloudShell creates CloudThinkerAccessRole with AWS's managed ReadOnlyAccess policy and a trust policy only CloudThinker can use:
{
"Effect": "Allow",
"Principal": { "AWS": "<CloudThinker principal shown in the dialog>" },
"Action": "sts:AssumeRole",
"Condition": { "StringEquals": { "sts:ExternalId": "<your External ID>" } }
}
CloudThinker assumes the role through AWS STS and gets short-lived credentials, so there's no long-lived AWS secret to leak or rotate. AWS is the exception, though. Other connections store a long-lived secret (an access key, client secret, JSON key or API token), and you rotate it: replace it on the connection, then revoke the old one at the provider.
On most connections, including AWS, Kubernetes and GitHub, Allow writes starts on. That's deliberate: a read-only credential already blocks every change, so the credential is the control that matters. A connection isn't read-only on its own. Start with a read-only credential, turn Allow writes off where you only want reads, and widen access when there's a specific change you want agents to make. Allowed writes still go through Auto Mode, so your team decides what runs on its own and what waits for approval.
Inside a workspace, reach narrows further. The built-in CloudThinker assistant can use every connection in the workspace. A custom agent reaches only the connections attached to it. Connections and credentials belong to one workspace, so production and staging in separate workspaces means separate access.
Where the key lives
CloudThinker keeps secrets in three places, each for one job.
01Connections
Infrastructure access
Cloud accounts, clusters, databases and tools. Injected only when a command runs.
02Credentials
Run-time secrets
Vendor API keys and tokens, passed to every command as environment variables.
03BYOK
Model access
Your own model provider keys. Nothing to do with your infrastructure.
Connection credentials are encrypted at rest with Fernet (AES-128 with an HMAC-SHA256 integrity check). They're injected into CloudThinker's managed Sandbox only when a command runs, never sent to an environment, and never shown in chat.
Workspace credentials hold everything else a command needs, such as a vendor API key or a webhook secret. Only workspace Admins can see or manage the list, and it shows key names, never values. Every credential reaches every command as an environment variable, whether or not the prompt mentions it. You point an agent at one by name:
Summarize this month's failed payments from the Stripe API using $STRIPE_API_KEY
The form rejects keys with reserved prefixes such as AWS_, GOOGLE_, AZURE_, KUBECONFIG and GITHUB_TOKEN. Cloud and Git access has one front door, and it's a connection. If a task needs a secret the workspace doesn't hold, the agent shows a secure form in chat, and what you submit is saved as a workspace credential marked with the agent that asked.
BYOK holds your own model provider keys, and has nothing to do with your infrastructure.
If a command prints a stored value anyway, CloudThinker swaps it for a placeholder before the model, the chat or stored output sees it. What Never Reaches the Model covers how that works and where it can miss. A command that sends a credential somewhere, like curl with $STRIPE_API_KEY in a header, goes through Auto Mode like any call to a connection.
What reaches your machine
Some work has to run where your code lives. CloudThinker has two ways to do that, and both keep connection credentials in the cloud.
01Your machine
Environment or CLI
- File toolsConfined to the served folder on an environment
- Shell commandsRun as your OS account
- Connection credentialsNever sent to the machine
Your code stays local
02CloudThinker Cloud
Connection commands
- Credential injectedOnly when a command runs
- WritesDecided by Auto Mode, same as chat
- Values in outputSwapped for placeholders
The key stays in the cloud
03Your provider
IAM decides
- Least privilegeStart with a read-only credential
- The ceilingNo agent does more than it allows
- Revoke at the sourceDisconnecting leaves the key there
You set the ceiling
An environment (beta) is a folder on a machine you run, such as a laptop, a build server or a CI runner:
cloudthinker worker start --outpost payments-api --workdir "$PWD"
File tools stay inside --workdir. Shell commands don't: they run as your OS account, across the whole machine. A connection command doesn't run in the environment at all. It runs in CloudThinker Cloud with the credential injected there, so the key never reaches your machine. The catch is the other direction: the shell can use credentials already on the machine, like ~/.aws or ~/.kube/config. Run the worker process under an account that doesn't have them, and turn off the Use Connections switch for a run that should stay entirely in the environment.
The CloudThinker CLI (beta) agent works the same way from the other side. Local tools, marked [L], run on your laptop as your OS user, with no credentials from CloudThinker. Cloud tools, marked [C], run on the workspace machine, where a connection credential is used for that run and never sent to your laptop. Cloud writes from the terminal are decided by your workspace's Auto Mode settings, like chat.
How you'd know: three records
The reviewer's third question gets three answers, because each record answers a different part of it.
01Conversation
The detail
Every command an agent ran, its output and each approval card.
02Audit Logs
Who did what
User, agent and system actions in one timeline. No edits, no deletes.
03Provider log
The API call
CloudTrail names each AWS session after the workspace that made it.
The conversation keeps the detail. Every command an agent runs, and its output, stays in the chat's history, along with any approval card and how it was answered.
Audit Logs answers "who did what" across the organization. On Scale, Scale Plus and Enterprise, organization Owners and Admins get one timeline of user, agent and system actions across every workspace, under Admin Settings → Audit Logs. It records connections created, edited, retried and deleted, credential replacements, approval decisions (including the ones AI judgment granted) and commands run through CloudThinker with their results. Agents appear as actors in their own right, so filtering Actor Type to Agent shows every action an agent took. Nobody can edit or delete an entry, Owners included, in the app or its API. Entries are kept for 90 days, and you can export them as CSV, up to the 10,000 most recent matching events per file.
Your provider's log sees every call too. CloudThinker names each AWS role session cloudthinker-<first 8 characters of your workspace ID>-<Unix timestamp>, so CloudTrail shows which workspace made each call.
For the reviewer's question: filter Audit Logs to the Connection category and search the connection's name to see who changed it. Switch Actor Type to Agent for what agents did with it, and to the Approval category for who approved those actions. Then match the times against CloudTrail by session name.
Some things are left out on purpose. A credential entry leaves out both the key name and the value, because more people can read audit logs than can manage credentials. To see which key changed, match the entry's time against the Updated date in the Credentials list. Sign-ins, sign-outs and page views aren't recorded, and neither is flipping a connection's Allow writes switch.
The design decisions
Access is declared at the provider. We don't invent a permission model on top of IAM. You already audit IAM, so the agent inherits that audit.
Secrets don't travel. The value goes in once, encrypted, and is injected where the command runs. It doesn't come back to the browser, the chat or a laptop.
Broken access stops work. When a connection's credential stops working, it flips to Error (for AWS, after three background failures in a row), admins get one notification per outage, and scheduled work that depends on it is skipped until it's fixed.
Agents are actors, not aliases. An agent action is logged as the agent's, not folded into the person who started the chat.
Honest limits
- Every workspace credential reaches every command. You can't limit one to an agent, run type or Automation. Keep a secret that only some work should see in a separate workspace.
- The secure form doesn't check roles. Any member who can chat, Developers included, can create a workspace credential through it, or overwrite an existing one. Check the list first when a key might already be in use.
- Shell in an environment is your account. CloudThinker adds no container or reduced privileges there, and Auto Mode won't stop a command that only acts on that machine, such as
rm. - The encryption key is CloudThinker-managed. Customer-managed keys aren't offered.
- Audit Logs has limits. It's on Scale and above only, keeps 90 days, and has no built-in stream to a SIEM. Export on a schedule if you need a longer record.
- Scope is your job. If a connection's credential is an admin key, the ceiling is admin. We tell you to start read-only. We can't make you.
Getting started
Connect one service with a read-only credential, then ask:
"Using the AWS connection, tell me what this role can and can't do, and which of my questions it couldn't answer because of permissions."
"Which connections and credentials can you use in this workspace? List them by name only."
"From my environment, run the tests in this folder, then check the failing service's deployed version in Kubernetes."
Then open Admin Settings → Audit Logs, set Actor Type to Agent and the date range to today, and find what you just asked for. The security page has the rest of the controls.



