anthropics / anthropics/claude-cookbooks

Cookbook proposal: SOSA — Safe Autonomous Agent Operations (production patterns + open-source examples)

Open
#477 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Jupyter Notebook
Stars
52.7k
Forks
6.3k
Avg merge
25m
Merged PRs (30d)
6

Description

## Proposal

I'd like to propose a cookbook entry covering **safe autonomous agent operations** — the patterns needed to run Claude-powered agents in production without things going sideways.

## Why this matters

The cookbook has great examples for individual API calls, tool use, and RAG — but nothing on how to safely run agents that operate *autonomously* over extended periods with real external tools (sending emails, managing CRM, posting to LinkedIn, processing invoices).

The community is hitting these gaps hard. On the Claude Code repo alone, there are multiple open issues about agents self-approving actions, bypassing permission boundaries, and losing safety context during compaction (#36690, #32029, #32646, #37157).

## What the cookbook entry would cover

Based on our experience running 30+ autonomous agents in production since early 2025, we'd propose covering:

1. **Graduated autonomy** — How to classify agent actions by impact level and enforce appropriate approval gates
2. 2. **Plan > Act > Verify loops** — Structuring agent execution so every action is auditable and reversible
3. 3. **Scoped credentials** — Never hardcoding secrets; declaring capability sets per agent
4. 4. **Prompt injection defense** — Scanning external data before processing
5. 5. **Trust gradients** — Expanding agent autonomy as reliability is demonstrated
6. 6. **Surviving context loss** — Maintaining safety state across compaction and session handoffs
## Existing material

We've already open-sourced everything needed:

- **SOSA methodology spec:** [SOSA.md](https://github.com/MSApps-Mobile/claude-plugins/blob/main/docs/SOSA.md)
- - **30+ production plugins** implementing these patterns: [github.com/MSApps-Mobile/claude-plugins](https://github.com/MSApps-Mobile/claude-plugins)
- - - **Security guide:** [SECURITY.md](https://github.com/MSApps-Mobile/claude-plugins/blob/main/docs/SECURITY.md)
Happy to contribute a cookbook entry (Jupyter notebook or markdown) with runnable examples. Would this be a welcome addition?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.