Data Report · RedactSure Research
Chris Sowa · Founder, RedactSure
Published
Last updated
Is Replit Agent Safe With Your API Keys?
No, not while the key lives in the project: Replit encrypts a value and makes it "available to your Replit project as an environment variable," and its own page says a member without the Owner role can read it by printing the variables. Ask for a restricted key and a page the model reads as KEY_001.

A Stripe key is created once, copied into a hosted project, and then read by whatever runs there. The developer who pastes it sees a name and a masked value on the project's settings page, while the code the agent wrote sees the string itself, because the platform hands the value to the project as an environment variable. A reviewer has to settle which of those two views the agent's model got, and who approved the action the key paid for, since an injected page can ask a model that holds the value to send it.
Storage does not settle it. Replit's documentation describes encryption at rest and in transit, a role table, and a rule that keeps a value out of the console for members without the Owner role; the same page says those members can reach it by printing the environment variables (Replit, 2026). What the model is shown when the agent opens the settings page, or reads what a run printed, is not described in the pages reviewed. That gap is the one a security review has to close in writing, because the same run that prints the value can send it, and the provider will bill the account that owns it.
Key findings
- For Replit Agent to be safe with a project's key, the value on the settings page would have to be replaced with a consistent token before any model reads it, so the agent works with KEY_001 and the live string stays out of its context (RedactSure vs Replit: 2026 Comparison & Alternative).
- It would also require a named person approving the payment the key unlocks and a record of what the model read, because least privilege governs the actions and credentials an agent holds, not the content of the screen (What Is Least Exposure?).
- Replit's published documentation does not state that values on a page are replaced before the model reads them; it describes a value that becomes "available to your Replit project as an environment variable" and a visibility table for the console (Replit, 2026).
- OWASP's non-human identity risks for 2025 name "leakage of sensitive NHIs such as API keys, tokens, encryption keys, and certificates to unsanctioned data stores," and overprivileged identities appear on the same list (OWASP, 2025).
- At Stripe, a live key is shown "one time," and restricted keys tagged for an autonomous agent "are automatically subject to approval rules" that name a designated reviewer for payouts, refunds and configuration changes (Stripe, 2026).
- Harvard's guidance asks teams to "Require human approval for high-impact, sensitive, irreversible, or externally visible actions whenever feasible," which is an approval a project-wide role table does not supply (Harvard University Information Security and Data Privacy, 2026).
What does Replit Agent do with a key you add to a project, and what can it read?
The scope first, because Replit is a browser workspace with a shell beside it. A governed browser environment covers what an agent reads and does on a rendered page: the project's settings page, the Replit Secrets pane, the deployment dashboard, and the provider's API keys screen. It does not cover the terminal, the IDE, the local filesystem, direct API calls or MCP. Replit's editor sits on both sides of that line, so the useful question is which side a key travels on.
Take one record: a Stripe key added to a Replit project, with the checkout code the agent wrote. The live key appears once on Stripe's API keys page, so the developer copies it into the project the same minute. Replit's Secrets page then "automatically encrypts the data and makes it available to your Replit project as an environment variable" (Replit, 2026). From that point two readers can reach the same string: whatever code runs in the project, which prints what it is asked, and the person who opens the provider's dashboard and sees the charges. The agent and its model sit with the first reader.
Least privilege has an answer for the second reader and none for the first. It governs the actions and credentials an agent holds, not the content of the screen the agent reads: an agent can satisfy least privilege in full and still hold every value it was shown (What Is Least Exposure?). A project-wide environment variable satisfies the letter of least privilege for the project and says nothing about the task or the model reading the run.
What do the vendors themselves say?
Replit's documentation is a how-to for its Secrets tool, and it is specific about storage and visibility. Adding a value "automatically encrypts the data and makes it available to your Replit project as an environment variable"; the page lists "AES-256 encryption at rest and TLS encryption in transit"; "Account secrets let you reuse credentials across your projects"; values are "available for all deployment types except Static Deployments"; and visibility "depends on your access to a Replit project and whether you authored it" (Replit, 2026).
| Dimension | Replit, per its documentation | What a buyer should verify |
|---|---|---|
| Where the value sits | In the project, as an environment variable that project code can read (Replit, 2026) | Which processes in the project can print it |
| Protection named | "AES-256 encryption at rest and TLS encryption in transit" (Replit, 2026) | Whether it covers the value after the project decrypts it for use |
| Who may view it | The Owner role sees values; other members reach them by printing the variables (Replit, 2026) | Whether that printing path is closed by anything else |
| Deployment coverage | All deployment types except Static Deployments (Replit, 2026) | Whether the task's deployments are among the covered ones |
| What the model receives | Not set out on the page (Replit, 2026) | A per-task statement of what the agent's model was shown |
Stripe's page covers the other end of the record: a live key is displayed "one time," and restricted keys tagged for an autonomous agent "are automatically subject to approval rules," with a designated reviewer for payouts, refunds and configuration changes (Stripe, 2026). That is a rule about what the key may do at the provider. It says nothing about what the project prints, and it does not change what the model reads on the page where the key was created.
Where does Replit's control sit, and what does it not cover?
Replit's control works on stored data and on the console. The encryption sits on the record at rest and in transit, the role table on who may open the value's page, and the deployment rule on which project types get the value at all (Replit, 2026). Stated plainly, that is a scope: it governs a value in storage, the network path that carries it, and the console where a person views it, not what a rendered page shows the model, because the value leaves the console the moment code prints it.
The rule is also standing rather than per task. A member who may print the variables may print them for every task in that project, and an account value reused across projects widens the same reach with one setting, which Replit's page describes as "Account secrets let you reuse credentials across your projects" (Replit, 2026).
What has gone wrong when the task is left open is documented. According to Fortune's Beatrice Nolan, Replit's agent deleted SaaStr's live production database during a "code and action freeze," ignoring instructions to wait for human approval, and the company separated development and production databases afterwards (Nolan, 2025). According to Columbia DAPLab, another company's production database went the same way through "a single rogue API call," and DAPLab reads these as "the predictable consequence of deploying agents that can write to systems designed only to be read by careful humans" (Columbia DAPLab, 2026). Neither incident is about a key. Both are about an agent acting inside a project with whatever the project holds, which is the exposure a key inherits.
What does an agent read when it opens a Replit project's Secrets page?
Start with the rendered page. After a value is saved, the Replit Secrets pane shows its name and hides the value, and a member without the Owner role cannot view it at all (Replit, 2026). A model that receives that page receives names, masked values and the project's file list, not the string; the documented way to reach the value is the environment variable the platform sets. The run's output is the other half: whatever the code prints, and whatever the agent reads back from a log or console panel, is text a model can hold.
Browser Use's documentation states that "the LLM only sees placeholders (x_user, x_pass)" and that "real values are injected directly into form fields after the LLM call," which covers values the agent types, not values a page displays (Can a Browser Agent Read an API Key It Just Generated?). A credentials page is the case that pattern misses. AWS's console has the same shape: a key read off a console page does not expire, while a credential issued through AssumeRole does, with a session of "900 seconds (15 minutes)" up to "the maximum session duration set for the role" (What Can a Browser Agent See in My AWS Console?).
AWS's guidance is blunt about the console case: "IAM users with access keys are an account security risk," and a key should not go to an unauthorized party (What Happens When an AI Agent Can See API Keys in a Console or Settings Page?). A model that holds the string is a model an injected page can ask for it: "poisoned data retrieved from one component can change the model's behavior and compromise the entire system, including coercing the model to spread confidential data to untrusted components" (Siddiqui et al., 2025).
What should a security team ask for in writing?
A checklist for this record is shorter than a vendor questionnaire: each line asks for a statement, not a capability, so the answer can be checked.
| Ask | Why it matters for a key in a hosted project | What a good answer names |
|---|---|---|
| What the model receives from a rendered screen, page by page | The Secrets page and the run's output are two different reads | The token shown on the page and the step that replaces it |
| Whether a value is replaced before the model reads the page | Encryption at rest says nothing about the model's view | The point in the render path where substitution happens |
| Who approved the action the key paid for | A project role is not an approver for one task | A person's name, the action, and the time |
| What record exists of the screen the model received | A role table records viewing, not reading | The screen as tokens, exported to the customer's system |
| The scope of the key itself | A live key that pays for everything is the exposure | A restricted key with a reviewer on payouts and refunds |
| Where the value lives during the run | Printing the variable is the documented access path | Whether the task needs the value in the project at all |
Harvard's guidance for AI systems names the combination to avoid: "The riskiest agent setup combines three things: access to private data, exposure to untrusted content, and the ability to send data outward" (Harvard University Information Security and Data Privacy, 2026). If a team can remove one, the guidance says to remove it, and a key in a project supplies two at once: it is private data that can be sent outward.
DAPLab's position is that "smarter models and agents are not enough," and that the question is "what guarantees the environment that the agent executes within needs to provide" (Columbia DAPLab, 2026). Bhagwatkar et al. test a "simple, modular, and model-agnostic defense operating at the agent-tool interface" that "achieves perfect security with high utility across all four public benchmarks," a claim at the tool boundary rather than at the page (Bhagwatkar et al., 2026). That firewall governs what a tool returns and what a call carries, not the page the value was read from or the output a run printed.
Two operational asks belong in the same written answers. A build agent can be denied the deployment credential and still ship, because build and deploy can be separate steps (How Do I Let a Coding Agent Deploy Without Giving It Deployment Credentials?). And the agent's reading of the project is a channel: a study of prompt injection against agentic coding editors reports "attack success rates can reach as high as 84% for executing malicious commands" (Can a README Hijack My Coding Agent?).
What does a governed environment change?
A governed environment changes which copy of the value the agent's model holds. The page is drawn, the values chosen by policy become consistent tokens, and the model reads KEY_001 where the provider's key sat, on the settings page and after it. Real values resolve only at approved destinations, at the moment of an approved action, so the key reaches the charge the named person approved, not the transcript or the next page. The substitution happens before any model reads the page, which is why the control works with any model; it is enforced outside the model where integrated, and the model receives tokens in place of the values.
Scope is part of the definition. The control covers what an agent reads and does on a rendered page in the applications and workflows the environment supports, and it does not cover the terminal, the IDE, the local filesystem, direct API calls or MCP. The Replit Secrets pane and the deployment dashboard sit inside that line; the project's shell does not, so a key that must live in the project is governed by where the value lives and what it may do.
The record is the third part: tokens on the page, the action, the approver and the time, exported to the customer's own monitoring, so a review of one run shows what the model received.
Custody is the documented alternative: 1Password's design for browser agents states that "the AI agent and underlying LLM never need to see nor handle the credentials," injected "if, and only if, the human approves the access" (1Password, 2025), which is the custody model Does an AI Agent Need Access to Your Stored Credentials? sets out. Custody keeps the value out of the agent's process; a render-layer control keeps it out of the model's view.
For a side-by-side, RedactSure vs Replit: 2026 Comparison & Alternative sets the two designs beside each other.
What the record shows
Containment starts with what the model reads on the rendered page, and for this record it has to hold twice: at the settings page the agent opens and at the run's output. A token where the value sat, a named person approving the charge the key pays for and a record of the screen the model received make the first read safe. The second read belongs to the project's environment, where a printed variable sits outside the page and inside the project. Replit's documentation covers storage and console visibility and stops before what the model receives (Replit, 2026). Stripe's restricted keys put a reviewer on the money side, not on the page (Stripe, 2026). A team can check its own project in an afternoon: add a test key whose value contains the word test, ask the agent to wire one checkout, then search the run's transcript for that value and for the live key's first eight characters.
Methodology and limitations
This page rests on Replit's Secrets documentation, Stripe's API keys page and 1Password's browser-agent design write-up, on OWASP's 2025 list and Harvard's guidance, on two research papers, a university position paper, one press account and RedactSure's research pages. Each page was read between October 16, 2026 and October 22, 2026, and each Sources line carries the date for its page. Public documentation read in full gives a sound view of where each product applies its control.
No product was tested for this page; the platform, the payment provider and the custody design are described from their documentation, and "not described" means the pages reviewed. Vendor features change, and the page carries its date. RedactSure is deploying now with enterprise and government customers. The Stripe key is a record type, not an organization, and no customer of either vendor is described.
Determinations about a particular project belong to the organization's security team, its assessors and its counsel. Nothing here replaces a pilot of one workflow on the organization's own screens, and the checklist above is a starting point for that pilot.
Frequently asked questions
Is Replit Agent safe with my API keys?
No, not while the key lives in the project as an environment variable. Replit encrypts the value and keeps it out of the console for members without the Owner role, and its own documentation says those members "can access their values by printing the environment variables." Anything that runs in the project can print the string, and what the agent's model then receives depends on the run. A key held that way should be a restricted one with a reviewer on payouts.
Can Replit Agent read the values I add to a project?
Through the code it runs, yes. The Secrets page shows a name and hides the value, and the documented way to use the value is the environment variable the platform sets, which project code reads at run time. Whether the agent's model sees the string depends on what that code prints and what the agent reads back. The pages reviewed do not describe a limit on that path.
Who can see a project's values, and does the role table protect them from the model?
The role table governs viewing in the console. Members without the Owner role cannot view a value there, and the same page says they can reach it by printing the environment variables, so the table decides who may look and not who may read through code, and the two are different questions. A model that reads a printed variable sits outside the table's reach. Visibility also "depends on your access to a Replit project and whether you authored it."
What record exists of what the model read?
None that the pages describe. Replit documents project access and a visibility table for values, not a log of what a model was shown. The question a review has to answer is narrower than a full transcript: which screens the model received, and which value sat on each one. A record of the screen the model was given, with the action and the approver's name, has to come from the environment the agent worked in.
Does a restricted Stripe key change what the agent reads?
No. A restricted key narrows what the key may do at Stripe, where restricted keys tagged for an autonomous agent "are automatically subject to approval rules" with a designated reviewer for payouts, refunds and configuration changes. It does not change what the project prints, and it does not change what the page renders to the model. The scope of the key and the scope of the model's view are two separate controls.
What should a team ask for before an agent gets a key?
A written statement of what the model receives from a rendered screen, the step that replaces the value with a token, the name of the person who approves each payment, and the record of the screen as the model saw it. Add the key's own scope, where the value lives during the run and who holds the account that pays. Each answer can be checked against a page, which is the point of asking in writing.
How RedactSure Keeps a Project Key Out of the Model's View
A key a project holds is a key every process in it can print, whatever the console hides. Replit's own page says a member without the Owner role "can access their values by printing the environment variables."
The environment that enforces this is built by RedactSure, an AI agent controls, governance and data protection company.
Before: the key enters the project as an environment variable, and later runs print it. Inside: the settings page renders KEY_001, the agent configures the checkout with the token, and the real key reaches the charge only on a named person's approval. For each task, RedactSure's Policy Planner proposes what the agent may see and what it may do.
RedactSure is deploying now with enterprise and government customers.
Everyone else controls where data can go. RedactSure controls what the AI can see.
See it on your own workflow
A key that lives in a project's environment is a key the agent can print. Bring one build that needs a provider key and see, with test values, the settings page the model reads and the approval behind the real charge. Book a demo