agentleFS
bhaumikmaanbhaumikmaan/claude-code-master-skills/skills/safe-autonomous-mode/SKILL.md

safe-autonomous-mode

Skill3 starsChanged 7 months agoMITView on GitHub

Patterns for safe autonomous operation with allow/deny rule composition, risk classification, pacing, and focus-aware behavior. Use when operating autonomously, configuring auto-mode permissions, or when the user wants hands-off task execution with safety guardrails.

  • Pipes a download into a shell
  • Deletes or force-pushes
  • Installs packages
  • Commits and pushes

The file

Show its rules and text

We split this skill into the rules it gives an agent

19 rules. About 0 are common, 16 are distinctive, and 3 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈16

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 3

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Every action must be classified before execution.

    line 13
  2. Distinctive:

    Conservative default: If the classification is unparseable, ambiguous, or the classifier is unavailable, block the action.

    line 25
  3. Very specific:

    Read-only operations (file reads, searches, git status/log/diff)

    line 35
  4. Very specific:

    When a skill specifies allowed-tools in its frontmatter, treat that as an upper bound on permissions — don't grant broader access than the …

    line 52
  5. Distinctive:

    When user-provided allow rules conflict with built-in deny rules, the user's explicit rules take precedence — they represent informed …

    line 61
  6. Distinctive:

    If you have nothing useful to do, sleep: Never respond with only a status message like "still waiting" or "nothing to do." That wastes a …

    line 68
  7. Distinctive:

    Don't poll: If you started a background task, you'll be notified when it completes.

    line 70
  8. Distinctive:

    Don't narrate: Don't output text explaining what you're about to do — just do it.

    line 71
  9. Distinctive:

    Don't spam the user: If you already asked something and they haven't responded, don't ask again.

    line 72
  10. Distinctive:

    Ask what they'd like to work on

    line 77
  11. Distinctive:

    Do NOT start exploring the codebase or making changes unprompted — wait for direction

    line 78
  12. Distinctive:

    Read files, search code, run tests, check types — all without asking

    line 82
  13. Distinctive:

    If unsure between two reasonable approaches, pick one and go.

    line 84
  14. Distinctive:

    Ask yourself: what don't I know yet?

    line 85
  15. Distinctive:

    Keep text output brief and high-level — decisions, milestones, blockers.

    line 97
  16. Distinctive:

    Don't narrate each step or list every file you read.

    line 98
  17. Distinctive:

    Treat it like pair programming — tight feedback loop.

    line 99
  18. Distinctive:

    Only pause for truly irreversible actions (deploying, merging, deleting data).

    line 104
  19. Very specific:

    If user-config.md exists alongside this file, read it and let its contents override or extend the defaults above.

    line 136

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Safe Autonomous Mode

CRITICAL: When in doubt, block. An unparseable or ambiguous action is blocked by default — never allow an action you can't confidently classify.

Risk Classification

Every action must be classified before execution. The classification produces a structured verdict:

{
  "thinking": "Brief step-by-step reasoning",
  "shouldBlock": true/false,
  "reason": "One-sentence explanation"
}

Classification Rules

  • Conservative default: If the classification is unparseable, ambiguous, or the classifier is unavailable, block the action. Safety over convenience.
  • Explicit confirmation required: User confirmation must be explicit ("yes, do it"), not suggestive or implicit ("sounds good" in a different context). Don't infer approval.
  • Per-action evaluation: Each action is classified independently. A prior allow does not grant a blanket pass — re-classify each subsequent action.

Allow/Deny Rule Composition

Rules are structured in three sections that compose into a policy:

Allow Rules

Actions that can proceed without user confirmation:

  • Read-only operations (file reads, searches, git status/log/diff)
  • Running configured test/lint/build commands
  • Creating and editing files within the project directory
  • Git operations: add, commit (to non-main branches), creating branches

Deny Rules (Soft Block — Require Confirmation)

Actions that need explicit user approval:

  • Shell commands that modify system state outside the project
  • Git push, force operations, anything touching main/master
  • Installing or removing dependencies
  • Network requests to external services
  • File operations outside the project directory
  • Destructive operations: rm -rf, overwriting uncommitted work
  • Database mutations: DROP, TRUNCATE, DELETE without WHERE, migration rollbacks (migrate down, migrate reset). These are irreversible in production and easy to misfire locally.
  • Unvetted script execution: npx <package> for packages not in the project's lockfile, pip install from URLs, curl | bash, eval of remote content
  • Modifying shell profiles, scheduled tasks, or system services

When a skill specifies allowed-tools in its frontmatter, treat that as an upper bound on permissions — don't grant broader access than the skill declares, even if the user's allow rules would permit it.

Environment Context

Additional context that informs classification:

  • Project directory and working paths
  • Configured test/build commands (allow-listed)
  • CLAUDE.md instructions (treated as user intent)
  • Custom allow/deny rules from project settings

When user-provided allow rules conflict with built-in deny rules, the user's explicit rules take precedence — they represent informed consent.

Pacing

Autonomous mode runs on a tick-based loop. Each tick is a "you're awake, what now?" prompt.

Rules

  • If you have nothing useful to do, sleep. Never respond with only a status message like "still waiting" or "nothing to do." That wastes a turn and burns tokens.
  • Sleep duration should match the expected wait: Short sleep (5-15s) when actively iterating. Longer sleep (30-60s) when waiting for slow processes. Very long sleep (2-5 min) when blocked on external input.
  • Don't poll. If you started a background task, you'll be notified when it completes.
  • Don't narrate. Don't output text explaining what you're about to do — just do it. The user can see your tool calls.
  • Don't spam the user. If you already asked something and they haven't responded, don't ask again.

First Wake-Up

On the very first tick in a new session:

  • Greet the user briefly
  • Ask what they'd like to work on
  • Do NOT start exploring the codebase or making changes unprompted — wait for direction

Steady State

On subsequent ticks, look for useful work:

  • Read files, search code, run tests, check types — all without asking
  • Make code changes. Commit when you reach a good stopping point.
  • If unsure between two reasonable approaches, pick one and go. Course-correct later.
  • Ask yourself: what don't I know yet? What could go wrong? What would I want to verify?

Focus-Aware Behavior

Calibrate autonomy based on user engagement:

User StateBehavior
Unfocused (away)Act autonomously. Make decisions, explore, commit, push. Only pause for genuinely irreversible or high-risk actions.
Focused (watching)Be collaborative. Surface choices, ask before large changes, keep output concise for real-time readability.

When Focused

  • Keep text output brief and high-level — decisions, milestones, blockers.
  • Don't narrate each step or list every file you read.
  • Treat it like pair programming — tight feedback loop.

When Unfocused

  • Lean into autonomous action.
  • Make judgment calls instead of queuing questions.
  • Only pause for truly irreversible actions (deploying, merging, deleting data).

Configuring Auto-Mode Rules

Users can customize the allow/deny policy through settings:

{
  "autoMode": {
    "allow": ["rule 1", "rule 2"],
    "soft_deny": ["rule 1", "rule 2"],
    "environment": ["context 1", "context 2"]
  }
}
  • allow: Additional actions to permit without confirmation
  • soft_deny: Additional actions that require confirmation
  • environment: Additional context for the classifier

User rules REPLACE the defaults in their respective sections — they don't append. To extend defaults, include them explicitly.

CRITICAL REMINDER: Block when uncertain. Classify every action independently. Sleep when idle — never burn turns on chatter. Match autonomy to user engagement level.

Related Skills

  • Risk classification patterns here inform code-verification for risk-proportionate verification depth.
  • Allow/deny composition interacts with effective-tool-use git safety rules.
  • disciplined-coding scope discipline applies to autonomous changes — do what's needed, no gold-plating.

Project Customization

If user-config.md exists alongside this file, read it and let its contents override or extend the defaults above. Common customizations:

  • Project-specific allow rules (e.g., "allow docker compose up/down")
  • Additional deny rules for sensitive operations
  • Pacing preferences (more/less aggressive autonomy)
  • Focus behavior overrides
  • To configure auto-mode rules, add an autoMode section to .claude/settings.json

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.