# Hackers Are Coming for Your AI Coding Agent (Lock It Down Now)

## Executive summary

The proliferation of AI coding agents introduces significant security risks, as attackers are leveraging AI to execute large-scale exploits. This video details real-world attacks, such as configuration file manipulation and dependency compromise, and provides defensive strategies, including API key limiting and using the `agent-config-audit` skill to secure the agent's configuration.

## Key takeaways

- Configuration Files are Targets: Attackers have been observed modifying configuration files, such as `settings.json`, to automatically trigger the download of malicious software when coding agents start up.
- Dependency Compromise Risk: Compromised packages (e.g., the Microsoft agent framework Python package) can install startup hooks designed to silently collect sensitive data like cloud identity tokens and credentials.
- Secrets Leakage Vectors: Credentials can be exposed in plain text within a coding agent's conversation history (stored locally in a JSON L file) or in configuration files like `settings.local.json`, which is often committed to source control.
- Mitigating LLMjacking: A primary defense against LLMjacking is applying strict limits (weekly or permanent) to all LLM API keys to limit the damage from theft.

## Technical details

- Agent Configuration Vulnerabilities: Vulnerabilities include hidden instructions injected into global rules or `claw.md`, and the risk of a coding agent running commands without explicit user consent via configured hooks.
- Security Auditing Commands: Tools like Cloud Code offer commands such as `/h hooks` (to view configured hooks) and `/mcp` (to survey connected MCP servers) to help identify unauthorized additions to the agent's environment.
- The Agent Config Audit Skill: The `agent-config-audit` skill is designed to check for configuration issues, poisoned dependencies, secrets in local configuration, fake editor extensions, and LLMjacking doors.
- Credential Handling Best Practices: To prevent secrets from being stored in plain text, credentials should be placed in an `.env` file and accessed via environment variables, with hooks configured to prevent the agent from reading the file directly.

## Practical implications

- Implement configuration audits regularly to detect unauthorized hooks or injected instructions.
- Never input sensitive credentials directly into a coding agent; use environment variables instead.
- Enforce API key limits (e.g., $50 permanent limits) to mitigate the financial impact of LLMjacking.
- Ensure that configuration files containing secrets (like `settings.local.json`) are correctly added to the `.gitignore` file.

## Topics

AI Security, LLMjacking, Agentic Engineering, Configuration Management, CI/CD Security, agent-config-audit skill, Google's report on agentic threats

Source: https://www.youtube.com/watch?v=0q0UbO4oqgQ
