Skip to content

Clarify context for capacities - #80

Merged
themouette merged 3 commits into
mainfrom
themouette/netter-capability-context
Feb 17, 2026
Merged

themouette merged 3 commits into
mainfrom
themouette/netter-capability-context

Conversation

@themouette

@themouette themouette commented Feb 17, 2026 •

Copy link
Copy Markdown
Owner

Summary

Improves capability security context to be more concise, actionable, and user-friendly. Reduces verbose warnings while adding critical runtime checks to prevent common issues.

Changes

Security Context Improvements

  • Reduced verbosity: Security warnings reduced from 5-10 lines to 1-2 lines per capability
  • Tone shift: Changed from prohibitive ("NEVER do X") to informative guidance
  • Token efficiency: Net reduction of 23 lines across all capabilities

Affected capabilities:

  • chromium: 13 lines → 3 lines (removed usage examples, kept essential warning)
  • docker: 5 lines → 2 lines (focused on key risks: --privileged, socket mounting)
  • gh: 4 lines → 2 lines (scopes and verification reminder)
  • node: 5 lines → 2 lines (npm audit and review guidance)
  • python: 5 lines → 2 lines (venv and review guidance)
  • rust: 5 lines → 2 lines (cargo audit and build.rs warning)
  • gpg: 6 lines → 2 lines (socket forwarding explanation)
  • network-isolation: Removed aggressive "NEVER/DO NOT" language, kept policy info

Git Capability Enhancements

1. SSH Agent Detection

  • Checks SSH_AUTH_SOCK availability at runtime
  • Warns Claude NOT to reconfigure remotes or change URLs when SSH unavailable
  • Provides clear guidance: ask user to push from host or enable SSH forwarding with claude-vm -A agent
  • Problem solved: Prevents Claude from breaking remote configurations when trying to "fix" push issues

2. GPG Key Cache Check

  • Fast, non-blocking check using --batch --pinentry-mode cancel + timeout 1 (< 1 second)
  • Detects if GPG key is cached to prevent 30-second commit hangs
  • Warns Claude upfront if key is not cached
  • Problem solved: Prevents terrible UX of 30s timeout when committing with locked key

3. Conditional Signing Warning

  • Signing warning only appears when commit.gpgsign = true
  • Avoids confusion in projects without GPG signing
  • Acknowledges that cache status is at startup and may expire during session

Benefits

  • ✅ Better UX: Prevents 30s commit hangs with GPG key cache check
  • ✅ Protects remotes: SSH agent detection prevents configuration mistakes
  • ✅ More concise: Reduced token usage while maintaining security awareness
  • ✅ More helpful: Informative guidance instead of prohibitive commands
  • ✅ Context-aware: Conditional warnings only when relevant

Testing

Generated example context with all capabilities enabled to verify:

  • All security context is concise and actionable
  • SSH agent warning appears when SSH unavailable
  • GPG key cache status shown when signing enabled
  • No false confidence about key status (labeled "checked at startup")

@themouette themouette self-assigned this Feb 17, 2026
Make security context more concise and actionable across all capabilities:

- Reduce verbose security warnings from 5-10 lines to 1-2 lines per capability
- Change tone from prohibitive ("NEVER do X") to informative guidance
- Make git signing warning conditional (only shown when signing is enabled)

Add SSH agent detection to prevent remote reconfiguration attempts:
- Check SSH_AUTH_SOCK availability at runtime
- Warn Claude NOT to reconfigure remotes or URLs when SSH unavailable
- Provide clear guidance: ask user to push from host or enable SSH forwarding

Add fast GPG key cache check to prevent 30s commit hangs:
- Use --batch --pinentry-mode cancel for non-blocking check (< 1s)
- Warn upfront if key is not cached to prevent commit timeout
- Acknowledge that cache status is at startup and may expire

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@themouette
themouette merged commit f41be6f into main Feb 17, 2026
6 checks passed
@themouette
themouette deleted the themouette/netter-capability-context branch February 17, 2026 22:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant