The Keys Your AI Agents Carry: Keeping Credentials Safe on the Laptops Where Agents Work

Summary: The weeks before someone resigns are when customer lists, pricing and source code are most likely to walk out the door, and AI tools now make that data easier to reshape and carry. Companies that watch data movement on the device, in context, can protect what matters without treating every employee like a suspect.

AI agents on employee laptops work with every password, token and API key the employee can reach, and they leave copies of those keys in files nobody reviews. This article shows how to find the keys your agents hold, shrink what they can reach and stop secrets from leaving the device, without slowing your teams down.

A real-world scenario

At a 600-person logistics software company, a support engineer starts using an AI coding agent to automate ticket triage. To save time, she approves a few shell commands with “don’t ask again.” One of those commands includes a database connection string. Another calls the billing API with a live key pasted into the command line.

The agent saves those approvals to a local settings file. A week later, she wires the agent to the ticketing system and the cloud console through two local tool servers. Their tokens go into a plain-text config file in her home folder.

Nothing about this feels risky to her. The agent works, the tickets move, and her manager is happy. But her laptop now holds five long-lived keys that the agent can read and use, that IT never issued to the agent, and that no one will rotate when the project ends. When she copies the project folder into a container image for a demo, the settings file goes with it.

No attacker was involved yet. The exposure happened through ordinary, well-meant work.

The problem: laptops have become key stores

Every agent that does useful work needs credentials: API keys, personal access tokens, database passwords, cloud sessions. On a laptop, those keys tend to live in plain text, in places that no secrets vault or identity system tracks.

The scale is now measurable. Researchers who scanned public code found 31,088 distinct secrets in one popular coding agent’s local settings files across 23,276 repositories. Of the secrets they could test, 67% were working credentials, led by database logins, cloud tokens and AI service keys. The same team found 24,008 unique secrets in public agent tool-server (MCP) configuration files, including 2,117 valid credentials, and saw agent-assisted commits leak secrets at 3.2%, about twice the 1.5% baseline.

Those figures only count what reached public repositories. The larger pool sits on laptops: .env files, shell history, tool configs and downloaded exports that agents can read with the employee’s full authority.

Who is affected. Not just engineers. Analysts, marketers and operations staff now run desktop agents and connect them to SaaS tools. In a 300-person company, that can mean dozens of laptops holding keys to finance, customer and cloud systems.

What it costs. A stolen AI service key turns into a bill. In one set of incidents investigated by researchers, compromised enterprise credentials drove about 2.5 million AI model calls and roughly $100,000 in usage. A stolen database or cloud key is worse: it is a direct path to customer data, with breach notification, forensics and lost trust to follow.

How Gen AI changed it

Credentials on laptops are not new. Four things about AI agents make them far more dangerous.

The result: a key left on a laptop used to be a slow-burning risk. Now it is found faster, used faster and reaches further.

Why legacy approaches fall short

What a modern approach looks like

Analysts are converging on one idea: treat agents as identities in their own right, with owners, scoped access and a life cycle. Gartner’s six steps to manage AI agent sprawl include building a central agent inventory and defining each agent’s identity, permissions and life cycle. The same release notes that only 13% of organizations think they have the right AI agent governance in place. A September Gartner summary adds that running agents without unique identities exposes enterprises to access risks. The OWASP Non-Human Identities Top 10 lists secret leakage, long-lived secrets and over-privileged identities among the top risks.

For a lean team, that translates into six practical principles:

How Kitecyber helps

Kitecyber enforces at the endpoint, the one place that sees which agent is running, what it is connected to and what data it touches. One lightweight agent and one console cover the principles above.

What day one looks like. Deploy the agent to a pilot group of developer and power-user laptops; Kitecyber cites about one day to deploy, with under 2% CPU overhead. By the end of the first day you have an agent inventory and a ranked list of agents with secrets and admin access. In week one, rotate the keys tied to your highest-risk agents, move them out of plain-text configs, and turn on warn-then-block for secrets and source code going into AI tools.

SME decision-maker checklist

Quick wins for this week, and questions to put to any vendor:

Compliance angle

Agent credentials fall under controls you already report on. Auditors increasingly ask how they apply to AI.

Framework Where agent credentials show up
SOC 2 Logical access controls: issuing, scoping, reviewing and revoking credentials, including those used by software.
ISO 27001:2022 Annex A controls on authentication information, privileged access and asset inventory.
PCI DSS 4.0 Requirement 8 on system and application accounts, including no hard-coded passwords in scripts and config files.
HIPAA Security Rule Access control and audit controls for any agent that can reach systems holding ePHI.
CMMC / NIST SP 800-171 Identification, authentication and least privilege for processes acting on behalf of users.
EU AI Act General expectations of governance, logging and human oversight for AI systems in use.

The common thread: know which identities exist, give each the least access it needs, and keep evidence of who or what used it.

Key takeaways

See which of your agents hold the keys. Schedule a walkthrough at kitecyber.com and see it running on your own endpoints.

Ajay Gulati

Ajay Gulati is a passionate entrepreneur focused on bringing innovative products to market that solve real-world problems with high impact. He is highly skilled in building and leading effective software development teams, driving success through strong leadership and technical expertise. With deep knowledge across multiple domains, including virtualization, networking, storage, cloud environments, and on-premises systems, he excels in product development and troubleshooting. His experience spans global development environments, working across multiple geographies. As the co-founder of Kitecyber, he is dedicated to advancing AI-driven security solutions.

Scroll to Top