Skip to content

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

@msmobileapps

Description

@msmobileapps

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
    1. Plan > Act > Verify loops — Structuring agent execution so every action is auditable and reversible
    1. Scoped credentials — Never hardcoding secrets; declaring capability sets per agent
    1. Prompt injection defense — Scanning external data before processing
    1. Trust gradients — Expanding agent autonomy as reliability is demonstrated
    1. Surviving context loss — Maintaining safety state across compaction and session handoffs

Existing material

We've already open-sourced everything needed:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions