Secrets detection and redaction guard plugin for AgenticStack
Project description
agenticstack-guard-secrets
Secrets detection and redaction guard plugin for AgenticStack.
Scans agent input and output for credentials and replaces each with a
[REDACTED:<kind>] placeholder (or blocks the content entirely).
Detected secret kinds:
| Kind | Pattern |
|---|---|
openai-key |
sk-... API keys |
github-token |
ghp_ / gho_ / ghu_ / ghs_ / ghr_ tokens |
aws-access-key-id |
AKIA... access key ids |
slack-token |
xoxb- / xoxa- / xoxp- / xoxr- / xoxs- tokens |
bearer-token |
Bearer <token> authorization headers |
hex-secret |
32+ hex chars preceded by key/token/secret context words |
Install
pip install agenticstack-guard-secrets
Use
from agenticstack import Agent
from agenticstack_guard_secrets import SecretsGuard
# Redact mode (default): secrets are replaced before they reach the
# model or the conversation history.
agent = Agent(name="Helper", guards=[SecretsGuard()])
# Block mode: refuse content containing secrets outright.
agent = Agent(name="Strict", guards=[SecretsGuard(block_instead_of_redact=True)])
Or resolve it by name once the plugin is activated:
from agenticstack import get_runtime
# Auto-discovered via the `agenticstack.plugins` entry point:
await get_runtime().activate("agenticstack.guard-secrets")
agent = Agent(name="Helper", guards=["secrets"])
SecretsGuard subclasses the plain Guard ABC, so it runs on both agent
input and output.
Permissions
None — pure-Python regex scanning with no network, filesystem, shell, or environment access.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file agenticstack_guard_secrets-0.1.0-py3-none-any.whl.
File metadata
- Download URL: agenticstack_guard_secrets-0.1.0-py3-none-any.whl
- Upload date:
- Size: 4.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/7.0.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2de2e0e5702a1cf9b93ae4614c0e36d71ec9260d1a087c9e581607c45143b082
|
|
| MD5 |
c471fc76d4c357473689261008f4624a
|
|
| BLAKE2b-256 |
5ab5ed832ba6ac5df9bceb94c400bc901a98d179bb71ced2f415bd66708375e6
|