wicked-garden-agentic-trust-and-safety
Skill9 starsChanged 7 months agoMITView on GitHub
Trust, safety, and control patterns for production agentic systems with human-in-the-loop gates and guardrails.
In this repository142 other files it gives its agents.
- AGENTS.mdAGENTS.md
- .claude/CLAUDE.mdCLAUDE.md
- plugin-json-schemaSkill
- readme-style-guideSkill
- releaseSkill
- scaffoldSkill
- wicked-garden-agentic-agentic-patternsSkill
- wicked-garden-agentic-architectSkill
- wicked-garden-agentic-context-engineeringSkill
- wicked-garden-agentic-frameworksSkill
- wicked-garden-agentic-performance-analystSkill
- wicked-garden-agentic-review-methodologySkill
- wicked-garden-agentic-safety-reviewerSkill
- wicked-garden-agenticSkill
- wicked-garden-appsSkill
- wicked-garden-archetypeSkill
- wicked-garden-build-guideSkill
- wicked-garden-classifySkill
- wicked-garden-coreSkill
- wicked-garden-data-engineerSkill
- wicked-garden-dataSkill
- wicked-garden-deliberateSkill
- wicked-garden-demoSkill
- wicked-garden-domain-coverageSkill
- wicked-garden-domain-extractorSkill
- wicked-garden-domain-modelerSkill
- wicked-garden-domainSkill
- wicked-garden-draftSkill
- wicked-garden-editor-scaffoldSkill
- wicked-garden-engineering-api-documentarianSkill
- wicked-garden-engineering-architectureSkill
- wicked-garden-engineering-backendSkill
- wicked-garden-engineering-debuggingSkill
- wicked-garden-engineering-docsSkill
- wicked-garden-engineering-frontendSkill
- wicked-garden-engineering-integrationSkill
- wicked-garden-engineering-large-scale-migrationSkill
- wicked-garden-engineering-migration-engineerSkill
- wicked-garden-engineering-patchSkill
- wicked-garden-engineeringSkill
- wicked-garden-engineering-solution-architectSkill
- wicked-garden-engineering-system-designSkill
- wicked-garden-engineering-unit-test-qualitySkill
- wicked-garden-governed-workerSkill
- wicked-garden-groundSkill
- wicked-garden-jam-brainstorm-facilitatorSkill
- wicked-garden-jam-councilSkill
- wicked-garden-jamSkill
- wicked-garden-learnSkill
- wicked-garden-mcp-scaffoldSkill
- wicked-garden-mcpSkill
- wicked-garden-mem-captureSkill
- wicked-garden-mem-ingestSkill
- wicked-garden-memSkill
- wicked-garden-personaSkill
- wicked-garden-platform-auditSkill
- wicked-garden-platform-compliance-officerSkill
- wicked-garden-platform-complianceSkill
- wicked-garden-platform-errorsSkill
- wicked-garden-platform-gate-benchmark-rebaselineSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
6 rules. About 0 are common, 6 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈6
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 24
Auditability: All decisions and actions are logged and traceable
- Distinctive: line 72
Check outputs before acting on them:
- Distinctive: line 81
Source Verification: Verify claims against ground truth
- Distinctive: line 83
Fact Checking: Use retrieval to verify factual claims
- Distinctive: line 96
Containerization: Run agents in Docker containers
- Distinctive: line 119
Use clear delimiters to separate system instructions from user input.
≈ “Common” is an estimate: at least 1 in 5 of the 372,429 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Trust and Safety
Essential patterns for building safe, trustworthy, production-ready agentic systems.
Core Principles
- Least Privilege: Agents have minimum necessary permissions
- Defense in Depth: Multiple layers of safety checks
- Fail Safe: Errors should fail toward safety, not capability
- Human Oversight: High-stakes decisions require human approval
- Auditability: All decisions and actions are logged and traceable
- Graceful Degradation: System remains safe even when components fail
Human-in-the-Loop Gates
When to Add Human Gates
Always require approval for:
- Production data modifications (delete, update critical data)
- Financial transactions above threshold
- Communications to external parties
- Credential or security changes
- Irreversible operations
Consider approval for:
- First-time operations
- Operations outside normal patterns
- Low-confidence decisions
- Operations near resource limits
Implementation Pattern
async def execute_with_approval(action, threshold=0.8):
if action.confidence < threshold or action.is_high_stakes():
approval = await request_human_approval(action)
if not approval.approved:
raise ApprovalDenied(approval.reason)
return await action.execute()Approval Workflow Design
Synchronous Approval: Block until human responds (for urgent decisions) Asynchronous Approval: Queue for later review (for batch operations) Escalation Chains: Route to higher authority if primary approver unavailable Timeout Handling: Define what happens if no approval received
See refs/guardrails-input-output.md, refs/guardrails-actions.md, and refs/guardrails-resources.md for detailed implementation patterns.
Output Validation
Structured Output Validation
Force outputs into validated schemas using Pydantic or similar.
Content Validation
Check outputs before acting on them:
- Format validation: Matches expected structure
- Range validation: Numeric values within acceptable bounds
- Completeness validation: Required fields are present
- Consistency validation: Outputs are internally consistent
Hallucination Detection
Cross-Validation: Multiple agents check same fact Source Verification: Verify claims against ground truth Confidence Thresholds: Reject low-confidence outputs Fact Checking: Use retrieval to verify factual claims
See refs/guardrails-input-output.md for code examples.
Action Constraints and Sandboxing
Whitelisting
Safer than blacklisting. Define allowed commands/actions explicitly.
Sandboxing
Isolate agent execution:
- Containerization: Run agents in Docker containers
- Virtual environments: Separate Python/Node environments
- File system restrictions: Limit access to specific directories
- Network isolation: Control network access
Resource Limits
Prevent runaway resource usage:
- Max runtime (timeouts)
- Max memory
- Max tokens per request/session
- Max API calls
See refs/guardrails-actions.md and refs/guardrails-resources.md for implementation details.
Prompt Injection Defense
Input Sanitization
Clean user inputs before passing to LLM. Remove instruction-like patterns.
Delimiter-Based Protection
Use clear delimiters to separate system instructions from user input.
Privilege Separation
Separate instruction and data contexts using role-based message formatting.
See refs/guardrails-input-output.md for defense patterns and code examples.
PII Detection and Protection
Pattern-Based Detection
Regex patterns for email, SSN, credit cards, phone numbers, etc.
Redaction
Replace detected PII with [REDACTED_TYPE] tokens.
PII Policies
- Never log PII in plain text
- Encrypt PII at rest and in transit
- Minimize PII collection (only collect what's needed)
- Retention limits (delete after specified period)
See refs/guardrails-input-output.md for detection and redaction code.
Hallucination Mitigation
Grounding Techniques
Retrieval-Augmented Generation (RAG): Retrieve facts before generation Citation Requirements: Require source citations for all claims
Verification Strategies
Multi-Agent Verification: Independent verification by multiple agents Confidence Calibration: Require confidence scores, reject low-confidence outputs
See refs/guardrails-actions.md and refs/guardrails-resources.md for implementation patterns.
Kill Switches and Circuit Breakers
Kill Switch: Emergency stop that halts all operations and alerts administrators. Circuit Breaker: Opens circuit after threshold failures to prevent cascading failures. Rate Limiting: Limits requests per user/time window to prevent abuse.
See refs/guardrails-actions.md and refs/guardrails-resources.md for complete implementations.
Safety Checklist
See refs/safety-checklist-core.md for the full pre-deployment checklist covering human gates, validation, whitelisting, resource limits, PII, prompt injection, hallucination, circuit breakers, rate limiting, kill switches, audit logging, and rollback. See refs/safety-checklist-advanced.md for monitoring, incidents, testing, and ops checklists.
References
refs/safety-checklist-core.md- Core safety checklist (input, output, action, auth, privacy)refs/safety-checklist-advanced.md- Advanced safety checklist (monitoring, incidents, testing, ops)refs/guardrails-input-output.md- Input validation, sanitization, prompt injection, output filteringrefs/guardrails-actions.md- Action whitelisting, approvals, sandboxed executionrefs/guardrails-resources.md- Resource limiting, monitoring, complete guardrail architecture
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

