# Ai Safe

> Keep credentials and Git history away from AI agents by creating sanitized workspaces and automated security reviews.

Ai Safe is a free AI agent skill pack (several skills in one listing) on Agensi by milcennii, in Security. It loads into your AI agent through the Agensi MCP server, always in its latest approved version.

- Price: Free
- Creator: [milcennii](https://www.agensi.io/creators/milcennii)
- Category: [Security](https://www.agensi.io/skills/security)
- Version: 1.0.7
- Last updated: 2026-12-03
- Security: scan passed (2026-12-03); every new listing is also reviewed by a person
- Listing: https://www.agensi.io/skills/ai-safe
- Tags: security, python, git, llm-ops, code-review, php, secret, key

## About this skill

Giving an AI agent full access to your source code often means exposing environment variables, private keys, passwords, API keys, internal hostnames, sensitive emails and Git history. This skill package installs and manages the `ai-safe` CLI to create sanitized workspaces where secrets are replaced by deterministic placeholders, allowing agents to work without seeing real credentials.

### What it does
- **Workspace Sanitization** creates a redacted copy of your repository with placeholders like `${AI_SAFE_SECRET_DB_PASSWORD}` instead of real values.
- **Secret Scanning** identifies credentials across the working tree, staged changes, and full Git history without displaying secret values.
- **Change Review** compares AI-generated code against a pristine snapshot to detect hardcoded credentials or placeholder misuse before integration.
- **Safe Integration** guides the developer through merging reviewed changes back to the original repository using a fail-closed patch process.
- **Security Auditing** generates evidence-based reports on workspace isolation, credential handling, and potential leak risks.

### How it works
1. **Setup** the developer runs the installer to add the `ai-safe` CLI and its companion skills to their environment.
2. **Sanitize** the developer executes `ai-safe start` in their original repository to create a secure workspace.
3. **Operate** the AI agent works exclusively within the sanitized workspace, referencing `AI_SAFE_PLACEHOLDERS.md`.
4. **Review** the agent runs `ai-safe review` to ensure no sensitive data or broken placeholders were introduced.
5. **Integrate** the developer runs `ai-safe integrate` in their terminal to apply the AI's patches to the original repo.

### Frameworks & tools
This skill uses Python 3.11+, Git, and `gitleaks`. It integrates with AI agents via specialized `SKILL.md` files for scanning, auditing, and workspace management.

### Why this beats prompting it yourself
Standard system prompts cannot prevent an agent from accidentally reading a `.env`/config file or seeing secrets in Git logs. This skill enforces a physical boundary by moving the agent to a directory where those secrets literally do not exist, while providing the CLI tools to verify that isolation remains intact.

### Use cases
- Prevent AI agents from accessing `.aws`, `.ssh`, or `.npmrc` files during coding tasks.
- Provide a sanitized project copy to an agent without including sensitive Git history or author metadata.
- Verify that AI-generated PRs do not contain hardcoded API keys or passwords.
- Audit how an agent handles environment variables to ensure it follows secure coding practices.

### Known limitations
Requires Python 3.11 or higher and Git. AI agents are prohibited from running the integration and sanitization steps themselves to maintain the security boundary.

## Requires

- Runs on macOS only
- Python
- Git

## How to use this skill

1. Connect your AI agent to Agensi once: add the MCP server https://mcp.agensi.io/mcp/auth and sign in with your Agensi account (OAuth, no API key). Steps for Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and other agents: https://www.agensi.io/docs/mcp-setup
2. Ask your agent: "Use the Ai Safe skill from Agensi" and describe your task.
3. Your agent loads the skill from Agensi when it needs it. Nothing is downloaded.

## Frequently asked questions

### How does this skill prevent my AI agent from seeing my private API keys and secrets?

This skill creates a sanitized workspace where sensitive environment variables and private keys are replaced with placeholders, ensuring the agent cannot access real credentials even if it scans the directory or Git history.

### What software do I need to have installed to use this skill?

You need Python 3.11 or higher and Git installed on your system to run the underlying security tools and workspace management CLI.

### What kind of reports or files does this skill produce?

The skill provides evidence-based security audit reports on workspace isolation and generates a specialized file called AI_SAFE_PLACEHOLDERS.md for the agent to reference.

### Can the AI agent merge its own code back into my original repository?

The agent is restricted to working in the sanitized environment and is strictly prohibited from running the final integration and sanitization steps to maintain a secure boundary.

### Does this skill protect against secrets hidden in my Git history or configuration files?

This skill is specifically designed to block access to sensitive files like .aws, .ssh, or .npmrc, and it scans staged changes and Git history to ensure no hardcoded credentials are introduced.

### How should I direct my AI agent to use these security features?

You can prompt your agent to work within the sanitized workspace and use the review command to verify that no sensitive data or broken placeholders were added to the code.

---

Source: [Agensi](https://www.agensi.io), the marketplace of skills for AI agents. Any MCP-compatible agent (Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and more) connects at https://mcp.agensi.io/mcp/auth and signs in with an Agensi account; setup for every agent: https://www.agensi.io/docs/mcp-setup. Append .md to any skill, guide or docs address on agensi.io for its markdown version.
