Skip to main content
Part of the security infrastructure for AI agents

Keep secrets out of AI context.

Keep AI coding tools away from credential files: a hook in Claude Code, instruction or ignore files in other tools. Store secrets in encrypted backends. Protect MCP server configs. One command to set up.

$npx secretless-ai init

Open source. secretless-ai 0.23.0.

The problem.

AI coding tools read your filesystem. That includes .env files, SSH keys, cloud credentials, and MCP server configs. Without protection, your secrets enter the context window on every interaction.

Without secretless

  • xAI reads .env files with API keys.
  • xCredentials sent to remote AI APIs.
  • xSSH keys and cloud credentials exposed in context.
  • xAI suggests hardcoded secrets in code.

With secretless

  • Secret files are off limits: denied by a hook in Claude Code, by instruction elsewhere.
  • Stored values are referenced by name instead of pasted into the context window.
  • In Claude Code, a shell command whose text reads a secret file or prints a secret variable is denied before it runs.
  • AI uses environment variable references instead.

How it works.

Secretless auto detects your AI tools, installs a protection for each, stores credentials in encrypted backends, and injects them at runtime.

1

Detect

Scans your project for AI tool config files. Finds .claude/, .cursorrules, .aider.conf.yml, and more.

2

Configure

Installs tool specific protections. Hooks for Claude Code, instruction files for Cursor and Copilot, ignore patterns for Aider.

3

Store

Secrets go into encrypted backends: local AES-256-GCM, OS keychain, 1Password, Vault, or GCP Secret Manager, instead of .env files.

4

Inject

At runtime, secrets are injected into the process as environment variables. The AI tool refers to them by name and works from the command's output.

What it does not cover.

For Cursor, GitHub Copilot, Devin Desktop (formerly Windsurf) and Cline, nothing enforces the instruction file Secretless writes, and it has no effect unless the tool loads that file.

The hook and the deny rules check a command by its text before it runs and cannot see its output, so a command that returns a credential, such as a cloud CLI call that fetches a secret, places the value in the model's context.

The gate sits on the assistant's tool path: it is not a boundary against other processes on the machine.

Get started with one command.

No signup. One command detects your AI tools and installs the protection each one supports. Store your secrets afterwards with the import or secret set command.

$npx secretless-ai init