Data Report · RedactSure Research
Chris Sowa · Founder, RedactSure
Published
Last updated
Can Cursor's Browser Agent See the API Keys I Generate?
It can, whenever the agent is the one that opens the page showing the key, because the page is what a browser agent reads. Check whether the control acts on the rendered page or on the project's file tree, since an ignore rule for files does not reach a screen.

Most teams that put an agent on a developer machine have already done the file work. The .env* line sits in .cursorignore, the default list covers it anyway, and the project's own credentials do not enter the editor's context. A key generated in a browser dashboard passes through none of that. The developer clicks Create key, the console paints the value once, and the page that shows it was drawn for a person to copy. Whatever reads that page receives it too, as text, as a screenshot, or as both. Cursor's security page documents approval gates for terminal commands and every MCP connection, and it says nothing about a value a page displays (Cursor, Security, 2026). The gap follows from where the browser sits in the stack: every layer that could have removed the value finished its work before the page rendered, because until recently nothing but a person read a rendered page. The case is an API keys page in a developer dashboard where a new key is shown once, and the same shape appears in a payments console, a hosting dashboard and a payroll portal. What matters is what the model receives at the reveal, and where the real key can be used after it.
Key findings
-
For the key to stay out of the model, the value on that page would have to be replaced with a consistent token before any model reads it, with the real key released only at the destination a named person approved (What Is Render-Layer Tokenization?).
-
It would also require a named person approving the key's creation and each later use, and a record of what the model received from the page, held where the team can query it (Does Cursor Keep an Audit Log of What the Agent Did?).
-
Cursor's published pages do not state that a value on a rendered page is replaced before the model reads it; they describe approval defaults for terminal commands and MCP connections (Cursor, Security, 2026).
-
Cursor's ignore documentation governs the file tree, where .cursorignore blocks "Code accessible by Agent, Tab, and Inline Edit" and code reached through @ mentions, and where the terminal and MCP tools "cannot block access to code governed by .cursorignore" (Cursor, Ignore, 2026).
-
GitLab's masking shows a substitution that stops at the log rather than the screen: the value is replaced with [MASKED] "in the job log," and masking "is not a guaranteed way to prevent malicious users from accessing variable values" (GitLab, 2026).
-
1Password and Browserbase describe the login half of the problem: agents "authenticate with web services without ever exposing credentials," and a person approves the access through "Real-time approval prompts via 1Password mobile or desktop" (1Password and Browserbase, 2025).
What does the model receive when the browser opens a key page?
The scope is the rendered page. A governed browser environment covers what an agent reads and does on a dashboard, a console, a settings page or a sign-up form, and it does not cover the terminal, the IDE, the local filesystem, direct API calls or MCP. A browser sits inside that line; a shell command sits outside it.
The record here is an API keys page in a developer dashboard, opened by an agent asked to create a deploy key for a staging project. The click on Create key returns one render, and that render carries the new key in its one-time reveal, the existing keys with their labels and last-used dates, the project's environment settings and the team members beside them. The task needed one value, and the page supplied a screen.
What a browser agent sends the model is that screen, as extracted text, as a screenshot, or as both. The key arrives with everything drawn around it, and the model can repeat it in a summary, write it into a file it is editing, or use it in a request the task never called for. The lower layers have finished their work by the time the page paints: access control decided the agent could open the console, the credential store encrypted the key at rest, and the browser kept the session in its own profile. None of them changed what the page shows, and the page shows the key (What Is Render-Layer Tokenization?).
One property of a one-time reveal makes the moment harder to undo. The console cannot show the value again, so after the render the only copy a team can inspect is the one in the model's context, the transcript or the agent's log. Whatever the page handed over is what the team now has to reason about, and the dashboard's own audit trail records who created the key, not what the screen showed the agent that created it (What Happens When an AI Agent Can See API Keys in a Console or Settings Page?).
Do Cursor's ignore rules cover a key that only exists on a page?
Cursor's documented file controls are specific about their reach. The .cursorignore page states that Cursor "blocks access to files listed in .cursorignore" for "Code accessible by Agent, Tab, and Inline Edit" and for "Code accessible via @ mention references." It also states that "The terminal and MCP server tools used by Agent cannot block access to code governed by .cursorignore," and it keeps the vendor's own limit: "While Cursor blocks ignored files, complete protection isn't guaranteed due to LLM unpredictability" (Cursor, Ignore, 2026).
Two details matter for a key page. Files in .gitignore and a default list that includes .env* are "automatically ignored," and the page does not say which features that exclusion applies to, so the safe reading is that those files are ignored somewhere in Cursor's context handling rather than blocked from every route an agent can take. And every one of these rules takes a path as its subject. A key the console generates and displays has no path until something saves it, and the saving happens after the model has read it.
The file case is well covered by the same vendor's other documentation, which is why teams treat it as settled (Does Cursor's Privacy Mode Keep API Keys Out of the Model?). A rule about which paths an agent may open answers a question about the workspace. A rule about what a rendered page may show the model answers a question about the browser, and Cursor's pages describe the first and leave the second to the application (Cursor, Ignore, 2026).
What do the vendors themselves say?
Cursor's security page is the document a buyer reads first, and its subject is the tool call. It states that "By default, terminal commands need your approval" and that "All MCP connections need your approval," and it warns that "AI can behave unexpectedly due to prompt injection, hallucinations, and other issues." The page describes the run modes as "best-effort guardrails rather than a hard security boundary," which is the right expectation to carry into a review: an approval prompt is a checkpoint on an action, not a boundary around a value (Cursor, Security, 2026).
Three other vendors document the pieces around it. Browserbase's authentication guidance tells a builder to "Log in once, then reuse the saved authentication state" and to "Store cookies, session tokens, and local storage to prevent repeated logins," which is how an agent browser keeps a session a person created (Browserbase, Authentication, 2026). 1Password and Browserbase describe the other end of a login: Secure Agentic Autofill lets an agent "authenticate with web services without ever exposing credentials," the credentials "are not shared with the LLM or exposed in Browserbase logs," and "Human-in-the-loop authorization" puts a person behind the access (1Password and Browserbase, 2025). GitLab's variable documentation shows a substitution that happens in a log, where "the value is replaced with [MASKED] in the job log," and it states that masking "is not a guaranteed way to prevent malicious users from accessing variable values" (GitLab, 2026).
| Question | Cursor, per its documentation | What a buyer should verify |
|---|---|---|
| What waits for a person | Approval for terminal commands by default, and for every MCP connection | Whether creating a key in a browser tool waits for anyone |
| What the file rules cover | Paths listed in .cursorignore, for Agent, Tab, Inline Edit and @ mentions | Whether a rendered page has any rule at all |
| How strong the gates are | "best-effort guardrails rather than a hard security boundary" | What the guardrail is expected to catch |
| What a page hands the model | Not described in the pages reviewed | Which values from the key page reached the model |
Read together, the four documents cover the workspace, the session and the log. None of them states that a value displayed on a page is replaced before the model reads it, which is the sentence the key page needs, and the console that shows a new key once is outside every rule the table lists (Cursor, Security, 2026).
What can an injected instruction do with a key the model has already read?
Once the key is in the context, the question changes from access to use. OWASP's entry for prompt injection states that "Indirect prompt injections occur when an LLM accepts input from external sources," and the mitigation it gives is to "Restrict the model's access privileges to the minimum necessary for its intended operations" (OWASP, Prompt Injection, 2025). That mitigation is written for a model whose privileges can be scoped. It does not treat a context that already holds a live key as a separate problem.
The research record treats the outcome as reachable. Greshake et al. showed that indirect injection can "enable adversaries to remotely (without a direct interface) exploit LLM-integrated applications," which is the class of attack a page of text sits in (Greshake et al., 2023). OWASP's sensitive information entry names the other half: personal data "may be disclosed during interactions with the LLM," a warning about what leaves the system when a model answers (OWASP, Sensitive Information Disclosure, 2025).
The sequence on a key page is short. A task that includes reading a documentation site or a package registry can carry text the developer did not write, and the model that holds the key also holds the instruction. An attacker does not need the key printed anywhere; it needs the model to put the value somewhere, and the model has both the value and the means. A key that never entered the context cannot be spent this way (How Do I Capture a Token the Moment It Appears on Screen?). A page that substituted the value before any model read it changes the result (Can a Browser Agent Read an API Key It Just Generated?).
What should a developer ask for in writing before an agent creates a key?
The useful ask is a sentence the vendor will sign, not a link to a trust page. The first line decides the rest: which values from the rendered screen does the model receive, and can the vendor show the substitution on the key page itself? A vendor that answers with an approval list has answered the action question, and the action is not where this exposure sits.
The second ask is about lifetime, because a key that exists for minutes is a smaller problem than one that exists for a year. AWS's AssumeRole reference is the model to hold a vendor to: the credentials it returns are temporary and last "from 900 seconds (15 minutes) up to" the role's maximum session duration, a session's permissions are "the intersection of the role's identity-based policy and the session policies," and "Role chaining limits your AWS CLI or AWS API role session" to one hour (AWS, 2026). Those limits bound what a stolen value can do. They do not change what the page showed.
The third ask is who approves, and the fourth is what record exists. For an agent that creates keys, the approver should be a named person who sees the service, the scope and the destination before the key is minted, which is the pattern 1Password describes for logins with "Human-in-the-loop authorization" behind an access request (1Password and Browserbase, 2025). The record should show what the page rendered to the model, what the agent did with it and who approved, exported to the customer's own monitoring. A team that has those four answers in writing knows where its keys can appear (How Do You Let an AI Agent Manage API Keys Without Reading Them?).
What does a governed environment change?
A governed environment changes what the model receives before the task is considered. Values chosen by policy are replaced with consistent tokens on the rendered page, so the key page arrives as KEY_001 and the token list beside it as KEY_002, and the model works with those labels for the whole run. The real value resolves only at the approved destination, at the moment of an approved action, so a deploy proceeds with the real key while the model holds a placeholder. The substitution happens before any model reads the page, which is what makes the control model agnostic: the same screen arrives as tokens whichever model is driving. Coverage is per workflow, and it applies to applications that render in the governed environment.
The other properties follow from that placement. A named person approves each consequential action, including the creation of a key and the request that spends it. Every screen the agent read as tokens, every action and every approval with a name lands in an exported record, so the team can answer what the model saw without asking the vendor for a log. The record is built around the page rather than the agent's summary of it, which is the difference between a transcript and an account of a run.
The comparison that fits this page's vendor sets that control beside Cursor's documented gates (RedactSure vs Cursor: 2026 Comparison & Alternative), and the record question has its own page (Does Cursor Keep an Audit Log of What the Agent Did?). What changes for the key page is small and checkable: the reveal still happens, the key is still created in the same console, and the value the model worked with was a token.
What the record shows
The exposure on a key page is set by the render, not by the task, and the questions that would catch it are about what the page handed the model, who approved the use and what record survived. The answer is specific: the dashboard draws the one-time key into the same screen as the token list and the project settings, Cursor's pages describe approval gates for terminal commands and MCP connections, and no page reviewed for this article states that a value shown on a screen is replaced before the model reads it (Cursor, Security, 2026). A developer can test this in an hour. Open the keys page for a staging project, write down every value on it that a person would call sensitive, then have the agent create one key while you record what the model receives. Compare the two lists, and the difference is the exposure the team carries. Rotating the key is the first step.
Methodology and limitations
This page rests on Cursor's agent security and ignore-file documentation, Browserbase's authentication guidance, AWS's AssumeRole reference, 1Password and Browserbase's partnership announcement, GitLab's CI/CD variable documentation, two OWASP entries and one research paper, plus the RedactSure pages cited in the body. Vendor and standards pages were read between October 20, 2026 and October 21, 2026, and each Sources entry carries the date for its page. Public documentation read in full gives a sound view of where each product applies its control.
The products are described from documentation and none was tested for this page, so "not described" means the pages reviewed and not a claim about code. Vendor features change and the page carries its date. The keys page is described as a record type, not an organization. RedactSure is deploying now with enterprise and government customers. Determinations belong to the organization's counsel, its assessors and its own security and compliance officers, and nothing here replaces a pilot of one workflow on the organization's own screens.
Frequently asked questions
Can Cursor's browser agent read the API key I generate?
Yes, when the browser tool is the thing that opens the page. A browser agent acts on what the page renders, so a key the console displays once arrives in the model's context as text, as a screenshot or as both, and it stays there for the run. Cursor's security page describes approvals for terminal commands and every MCP connection, and it says nothing about a value a page shows. The condition that changes the answer is a substitution on the rendered page before the model reads it.
Does .cursorignore cover a key that appears on a dashboard?
No. .cursorignore works on paths, and a key the console generates has no path until something saves it, which happens after the model has read it. Cursor's page says .cursorignore blocks code reachable by Agent, Tab and Inline Edit and through @ mentions, and that the terminal and MCP tools cannot block access to code it governs. A rule for the workspace answers a different question from a rule for the screen, and the second is the one a key page raises.
What does the model receive from the key page?
The whole rendered page, not the field the task needed. That includes the one-time key, the list of existing keys with their labels, the project's environment settings and the team members shown beside them, because the console draws one screen for a person to read. Cursor's documentation does not describe a step that narrows the render to the value the agent asked for. The useful test is to write down every sensitive value on the page and compare the list with what the run received.
Who should approve a key an agent creates?
A named person who sees the service, the scope and the destination before the key is minted, not the model confirming its own step. The approval belongs outside the agent's context, since a model asked to sign off on its own step is signing off on its own reading of the page. Cursor's approval defaults cover terminal commands and MCP connections, which are tool calls, and a key created in a browser tool is not one of those. What the approver sees decides whether the gate holds.
What record should exist of a key an agent has read?
One that shows what the page rendered to the model, what the agent did with it and who approved each consequential step, held where the team can query it. A record the agent writes about its own run is a self-report, and a self-report is the thing a reviewer is trying to test. Cursor's security page does not describe an exported record of what the model received, and a transcript the vendor holds does not answer a question the customer's monitoring should answer. Ask for the export path first.
Should I rotate a key an agent has already read?
Yes, if the page displayed the value while the agent was driving the browser. A one-time reveal means the console cannot show it again, so whatever reached the model is the copy to treat as exposed. Rotation limits what the old value can still do, and a short lifetime limits the next key. It does not change what the page will show the model on the next run, which is the part a substitution on the rendered page addresses.
How RedactSure Keeps a One-Time API Key Off the Model's Screen
A key the console reveals once exists only on that page, and a rule about project files never reaches it. Cursor calls its run modes "best-effort guardrails rather than a hard security boundary," so an approval on a tool call leaves the render uncovered.
The environment that enforces this is built by RedactSure, an AI agent controls, governance and data protection company.
Before, the model received the keys page as drawn: the new key in its one-time reveal, the existing keys with their labels. Inside, the key field arrives as KEY_001, the developer signs a grant naming the service, operation, destination and lifetime, a private adapter outside the agent's sandbox uses the real key for that request, and the model receives the response.
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
What the model receives at the reveal decides what that key costs you afterward. Bring one key you would ask an agent to create and see, with test values, the page as the model receives it and the approval. Book a demo