Agent skill · marketing growth · jeremylongshore

anth-policy-guardrails

Implement content policy guardrails, input/output validation,

Why this skill is useful

Provides specific implementation patterns for input/output validation and governance that enhance Claude API integrations.

What it needs

Requires anthropic account access. About 4k tokens when loaded. Last updated 2026-08-07. 2,604 stars on the source repository.

What this skill does

Anthropic Policy Guardrails Overview Implement application-level guardrails for Claude API: input validation, output filtering, topic restrictions, and cost governance. These complement Claude's built-in safety (Anthropic Usage Policy). Input Guardrails System Prompt Guardrails Output Guardrails Cost Governance Model Access Policy Prerequisites Establish the approved use policy, data classes, model/workspace allowlist, output destinations, retention period, and an owner for policy exceptions. Use a sandbox with synthetic inputs, a no-op tool registry, and redaction tests. Keep API keys in a secret manager with least-privilege access. Define a fail-closed response for blocked input/output and aggregate audit fields that exclude user text, completions, PII, credentials, and tool arguments. Instructions 1. Validate length, encoding, data class, user authorization, and requested model before making the API call. Reject or quarantine disallowed input rather than attempting to hide the policy decision in a prompt. 2. Keep trusted guardrails in the system parameter and mark user content as untrusted. Allow tools only by name and schema; require explicit approval for side effects or external destinations. 3. Validate the returned content and tool calls for sensitive data, policy violations, output size, and destination scope. Do not treat model compliance as a substitute for application enforcement. 4. Apply per-user and global budgets atomically, with a bounded maxtokens and rate limit. Emit an aggregate decision receipt for allow/block/transform outcomes. 5. Canary policy changes against synthetic adversarial fixtures, compare block/allow and leakage metrics, and roll back the policy bundle if an invariant fails. Output Produce a guardrail receipt containing policy version, input/output decision, model class, aggregate token/cost estimate, tool approval result, destination class, canary result, rollback reference, and retention/cleanup status. …

How to use it

Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:

@skills jeremylongshore/anth-policy-guardrails

View the source on GitHub

Browse the @skills marketplace