GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - jscheel/opencode-secrets-protect: OpenCode plugin that catches secrets before AI tools can leak them. Detects API keys, tokens, credentials, and private keys using pattern matching and entropy analysis. Stops leaks in writes and redacts them from output.

BranchesTags
Open more actions menu

Latest commit

 

History

5 Commits
5 Commits

Folders and files

NameName
Last commit message
Last commit date
src
src
 
 
.gitignore
.gitignore
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
bun.lock
bun.lock
 
 
package.json
package.json
 
 
tsconfig.json
tsconfig.json
 
 

Repository files navigation

opencode-secrets-protect

Warning This project is in alpha and has not been extensively tested in real-world environments. Use at your own risk and please report any issues you encounter.

An OpenCode plugin that protects against secret leakage in AI tool calls.

Features

  • Pattern-based detection: Detects 40+ types of secrets including:

    • AWS credentials (Access Key ID, Secret Access Key)
    • GitHub tokens (PAT, Fine-grained, OAuth, App tokens)
    • GitLab tokens
    • Slack tokens and webhooks
    • JWT tokens
    • Google API keys and OAuth tokens
    • Stripe keys
    • SendGrid, Twilio, Discord tokens
    • OpenAI and Anthropic API keys
    • NPM and PyPI tokens
    • Database connection strings (MongoDB, PostgreSQL, MySQL, Redis)
    • Private keys (RSA, SSH, PGP, EC)
    • Passwords in URLs
    • And more...
  • Entropy-based detection: Catches high-entropy strings that might be secrets even if they don't match known patterns

  • Safe pattern exclusions: Reduces false positives by ignoring:

    • URLs without credentials
    • File paths
    • Email addresses
    • UUIDs
    • Semantic versions
    • Git SHAs

Installation

Local plugin

Copy the plugin source to .opencode/plugin/ in your project:

cp -r src/* .opencode/plugin/

How it works

The plugin hooks into OpenCode's tool execution via tool.execute.after, scanning tool output for these tools:

  • read: Scans file contents
  • bash: Scans command output
  • grep: Scans search results

If a secret is detected in the output, it is replaced with a warning message to prevent the secret from entering the AI's context.

Configuration

The plugin can be configured through the plugin context. Default settings:

{
  // Tools to scan after execution
  scanToolsAfter: ["read", "bash", "grep"],

  // Entropy threshold (higher = fewer false positives)
  entropyThreshold: 4.5,

  // Enable entropy-based detection
  enableEntropyDetection: true,

  // Custom patterns to allow (regex strings)
  allowPatterns: [],
}

Development

# Install dependencies
bun install

# Run tests
bun test

# Type check
bun run typecheck

License

MIT

About

OpenCode plugin that catches secrets before AI tools can leak them. Detects API keys, tokens, credentials, and private keys using pattern matching and entropy analysis. Stops leaks in writes and redacts them from output.

Resources

Readme
MIT license
Activity

Stars

7 stars

Watchers

0 watching

Forks

2 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.