Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

agenticstack_guard_secrets-0.1.0-py3-none-any.whl (4.5 kB view details)

Uploaded Python 3

File details

Details for the file agenticstack_guard_secrets-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for agenticstack_guard_secrets-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2de2e0e5702a1cf9b93ae4614c0e36d71ec9260d1a087c9e581607c45143b082
MD5 c471fc76d4c357473689261008f4624a
BLAKE2b-256 5ab5ed832ba6ac5df9bceb94c400bc901a98d179bb71ced2f415bd66708375e6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page