Skip to main content

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.

Release files for agenticstack-guard-secrets 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for agenticstack-guard-secrets 0.1.0
File Interpreter ABI Platform
agenticstack_guard_secrets-0.1.0-py3-none-any.whl Python 3 none any Details

Release files / agenticstack_guard_secrets-0.1.0-py3-none-any.whl

Download URL agenticstack_guard_secrets-0.1.0-py3-none-any.whl
Size 4.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2de2e0e5702a1cf9b93ae4614c0e36d71ec9260d1a087c9e581607c45143b082
BLAKE2b-256 checksum
How to use checksums
5ab5ed832ba6ac5df9bceb94c400bc901a98d179bb71ced2f415bd66708375e6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.7

Release history Release notifications | RSS feed

This release

0.1.0 This release

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page