Securing AI Agents: Addressing the Non-Human Identity Crisis in Enterprises

The integration of artificial intelligence (AI) into enterprise operations has revolutionized productivity, with tools like GitHub Copilot enhancing code development and chatbots providing instant access to internal knowledge bases. However, each AI agent introduced into these systems requires authentication to interact with other services, leading to a significant increase in non-human identities (NHIs) within corporate cloud environments.

Currently, many organizations manage approximately 45 machine identities for every human user. These NHIs encompass service accounts, continuous integration and continuous deployment (CI/CD) bots, containers, and AI agents, all of which rely on secrets—such as API keys, tokens, or certificates—to securely connect with other systems. The proliferation of these identities has led to a surge in exposed secrets; for instance, over 23.7 million secrets were found on public GitHub repositories in 2024 alone. Notably, repositories utilizing AI tools like Copilot exhibited a 40% higher incidence of secret leaks compared to the average public repository. ([thehackernews.com](https://thehackernews.com/expert-insights/2025/04/the-new-frontier-of-security-risk-ai.html?utm_source=openai))

Understanding the Risks of Non-Human Identities

Unlike human users, NHIs often lack stringent policies for credential rotation, permission scoping, or decommissioning unused accounts. This oversight results in a complex web of high-risk connections that cyber attackers can exploit, sometimes long after the original secrets were created and forgotten.

The rapid adoption of AI, particularly large language models (LLMs) and retrieval-augmented generation (RAG) techniques, has exacerbated this issue. For example, an internal support chatbot powered by an LLM might access a Confluence page containing valid credentials when asked about connecting to a development environment. This scenario can lead to the inadvertent exposure of sensitive information, as the chatbot may disclose secrets to users who pose the right questions, and such information could be logged and accessed by unauthorized individuals.

Implementing Effective Governance for NHIs

To mitigate the risks associated with AI-driven NHIs, organizations should adopt the following five actionable practices:

1. Audit and Clean Up Data Sources: With the advent of RAG engineering, LLMs can access additional data sources as needed. However, if these sources contain embedded secrets, the associated identities are at risk. Platforms like Jira, Slack, and Confluence were not originally designed with AI or secrets management in mind. Consequently, if plaintext API keys are present, there are no inherent safeguards to prevent their exposure. Conducting thorough audits and removing or revoking any embedded secrets is crucial to prevent AI systems from inadvertently leaking sensitive information.

2. Centralize NHI Management: Managing NHIs in a decentralized manner can lead to oversight and increased security vulnerabilities. Centralizing the management of these identities allows for better visibility, control, and enforcement of security policies. Implementing a unified platform for NHI management can streamline processes such as credential rotation, permission scoping, and decommissioning of unused accounts.

3. Prevent Secrets Leaks in LLM Deployments: Deploying LLMs without proper safeguards can result in the unintended disclosure of sensitive information. Implementing measures such as input validation, output filtering, and monitoring can help prevent LLMs from exposing secrets. Additionally, training AI models with sanitized datasets that exclude sensitive information can reduce the risk of inadvertent leaks.

4. Improve Logging Security: Logs can inadvertently capture sensitive information, including secrets exposed by AI agents. Enhancing logging security involves implementing measures such as redacting sensitive information, restricting access to logs, and regularly auditing log data for potential exposures. Ensuring that logs do not contain sensitive information is essential to prevent unauthorized access and data breaches.

5. Restrict AI Data Access: Limiting the data that AI agents can access reduces the risk of exposing sensitive information. Implementing strict access controls, defining clear data access policies, and regularly reviewing and updating these policies can help ensure that AI agents only access the data necessary for their tasks. This approach minimizes the potential for unauthorized data exposure and enhances overall security.

Conclusion

The rapid integration of AI agents into enterprise environments has introduced a complex landscape of non-human identities, each requiring careful management to prevent security vulnerabilities. By auditing and cleaning up data sources, centralizing NHI management, preventing secrets leaks in LLM deployments, improving logging security, and restricting AI data access, organizations can effectively mitigate the risks associated with AI-driven NHIs. Implementing these practices not only enhances security but also enables developers to innovate and deploy AI solutions more rapidly and securely.