Synthèse automatique
Ce skill met en place un circuit de validation humaine (HITL) qui bloque les actions sensibles — envoi d'e-mails, publications LinkedIn, paiements, suppression de fichiers, appels API — jusqu'à ce qu'un utilisateur les approuve explicitement.
Points forts
- Classe les actions en sensibles ou non via un fichier approval_rules.yaml éditable, avec délais d'expiration par type d'action
- Matérialise chaque demande dans un dossier Pending_Approval avec un frontmatter YAML que l'utilisateur modifie pour approuver ou rejeter
- Envoie des notifications bureau et journalise toutes les décisions et résultats d'exécution pour l'audit
- Exécute l'action approuvée avec logique de retry et gestion d'erreurs, et conserve la raison en cas de rejet
Limites
- L'approbation repose sur une édition manuelle du frontmatter YAML : pas d'interface de validation dédiée
- Le polling des réponses et les notifications sont liés à un vault local et à des notifications système, ce qui suppose un environnement de bureau
- Le extrait fourni s'arrête au milieu de check_approval_status, donc certaines parties de l'API restent à vérifier
À utiliser lorsqu'un agent doit effectuer des actions à impact externe ou irréversibles et qu'une validation humaine explicite est exigée avant exécution.
À éviter pour des opérations de lecture seule ou des tâches entièrement automatisées où un blocage par approbation ferait perdre du temps sans bénéfice de conformité.
Analyse de sécurité
SûrThe skill describes a human-in-the-loop approval workflow with code snippets and configuration examples, but does not contain direct instructions to execute destructive, exfiltrating, or obfuscated actions. It does not declare or use any tools that would perform network, shell, or file operations beyond conceptual Python code. The content is instructional and focused on implementing approval mechanisms, not on executing sensitive actions autonomously.
Aucun point d'attention détecté
Comment cette analyse est faiteExemples
Draft and send the project update email to client@example.com, but create an approval request first so I can review it before it goes out.Check the Pending_Approval folder and tell me which approval requests are still waiting, then execute any that I've marked as approved.Add delete_file and api_call to the sensitive actions in approval_rules.yaml with a 60-minute timeout, and confirm emails and LinkedIn posts can never be auto-approved.Manage Approvals Skill
Skill ID: manage-approvals Version: 1.0.0 User Story: US2 - Human-in-the-Loop Approval Workflow Priority: P1 (MVP)
Purpose
Implement human-in-the-loop (HITL) approval workflow for sensitive actions. This skill ensures 100% compliance with the constitution requirement that all sensitive actions (emails, posts, payments) require explicit human approval before execution.
Capabilities
- Approval Request Creation: Create structured approval requests in Pending_Approval folder
- Approval Status Checking: Poll for user responses (Approved/Rejected)
- Desktop Notifications: Notify user of pending approvals using system notifications
- Action Execution: Execute approved actions with retry logic and error handling
- Audit Logging: Log all approval decisions and action results
Architecture
Core Components
-
ApprovalManager (
silver/src/approval/approval_manager.py)create_approval_request(action_type, action_details, risk_assessment)→ request_idis_sensitive_action(action_type)→ boolexecute_approved_action(request_id)→ result
-
ApprovalChecker (
silver/src/approval/approval_checker.py)poll_for_approvals()→ List[ApprovalRequest]check_approval_status(request_id)→ status (pending/approved/rejected)
-
ApprovalNotifier (
silver/src/approval/approval_notifier.py)send_notification(title, message, urgency)→ success
Approval Workflow
1. Action Detected → Is Sensitive? → Yes → Create Approval Request
→ No → Execute Directly
2. Approval Request Created → Move to Pending_Approval/
→ Send Desktop Notification
→ Poll for User Response
3. User Reviews → Edit YAML frontmatter → Set status: approved/rejected
→ Add reason (if rejected)
4. Status Detected → Approved → Move to Approved/ → Execute Action
→ Rejected → Move to Rejected/ → Log Reason
Configuration
Approval Rules (silver/config/approval_rules.yaml)
sensitive_actions:
# Email sending
- action_type: send_email
requires_approval: true
auto_approve_threshold: null # Never auto-approve
timeout_minutes: 1440 # 24 hours
# LinkedIn posting
- action_type: post_linkedin
requires_approval: true
auto_approve_threshold: null
timeout_minutes: 1440
# File operations
- action_type: delete_file
requires_approval: true
auto_approve_threshold: null
timeout_minutes: 60
# External API calls
- action_type: api_call
requires_approval: true
auto_approve_threshold: null
timeout_minutes: 120
non_sensitive_actions:
# Read-only operations
- action_type: read_file
requires_approval: false
- action_type: search_vault
requires_approval: false
- action_type: create_plan
requires_approval: false
notification_settings:
enabled: true
urgency: normal # low, normal, critical
sound: true
desktop: true
Usage
Create Approval Request
from silver.src.approval.approval_manager import ApprovalManager
manager = ApprovalManager(vault_path="/path/to/vault")
# Create approval request for email sending
request_id = manager.create_approval_request(
action_type="send_email",
action_details={
"to": "client@example.com",
"subject": "Project Update",
"body": "Here's the latest update...",
"attachments": []
},
risk_assessment={
"sensitivity": "high",
"reversible": False,
"impact": "external_communication"
}
)
print(f"Approval request created: {request_id}")
# Desktop notification sent to user
Check Approval Status
from silver.src.approval.approval_checker import ApprovalChecker
checker = ApprovalChecker(vault_path="/path/to/vault")
# Check status of specific request
status = checker.check_approval_status(request_id)
if status["status"] == "approved":
print("Action approved by user")
# Execute action
elif status["status"] == "rejected":
print(f"Action rejected: {status['reason']}")
# Log rejection
else:
print("Still pending approval")
Execute Approved Action
# Execute action with retry logic
result = manager.execute_approved_action(request_id)
if result["success"]:
print(f"Action executed successfully: {result['message_id']}")
else:
print(f"Action failed: {result['error']}")
# Retry logic: max 3 attempts, exponential backoff (2s, 4s, 8s)
Output Format
Approval Request File
Created in Pending_Approval/ folder:
---
id: approval_20260113_103045_abc123
action_type: send_email
status: pending
created_at: 2026-01-13T10:30:45Z
timeout_at: 2026-01-14T10:30:45Z
risk_level: high
---
# Approval Request: Send Email
**Action**: Send Email
**Status**: ⏳ Pending Approval
**Created**: 2026-01-13 10:30 AM
**Timeout**: 2026-01-14 10:30 AM (24 hours)
## Action Details
- **To**: client@example.com
- **Subject**: Project Update
- **Body Preview**: Here's the latest update...
- **Attachments**: None
## Risk Assessment
- **Sensitivity**: High
- **Reversible**: No
- **Impact**: External Communication
- **Consequences**: Email will be sent to external recipient
## Instructions
To approve this action:
1. Change `status: pending` to `status: approved` in the YAML frontmatter above
2. Save the file
3. The action will execute automatically within 1 minute
To reject this action:
1. Change `status: pending` to `status: rejected` in the YAML frontmatter above
2. Add `rejection_reason: "Your reason here"` to the YAML frontmatter
3. Save the file
4. The action will be cancelled
## Timeout
If no response within 24 hours, this request will expire and the action will be cancelled.
After Approval
File moves to Approved/ folder with updated frontmatter:
---
id: approval_20260113_103045_abc123
action_type: send_email
status: approved
created_at: 2026-01-13T10:30:45Z
approved_at: 2026-01-13T10:35:12Z
executed_at: 2026-01-13T10:35:15Z
execution_result: success
message_id: <abc123@smtp.gmail.com>
---
After Rejection
File moves to Rejected/ folder with rejection reason:
---
id: approval_20260113_103045_abc123
action_type: send_email
status: rejected
created_at: 2026-01-13T10:30:45Z
rejected_at: 2026-01-13T10:35:12Z
rejection_reason: "Not ready to send yet, need to review content first"
---
Dependencies
Python Packages
[tool.poetry.dependencies]
plyer = "^2.1.0" # Desktop notifications
pyyaml = "^6.0.1"
python-dotenv = "^1.0.0"
watchdog = "^4.0.0" # File system monitoring (optional)
System Requirements
- Python 3.13+
- Desktop notification support (Linux: libnotify, Windows: native, macOS: native)
Setup Instructions
1. Configure Approval Rules
# Edit approval rules
nano silver/config/approval_rules.yaml
# Customize sensitive actions, timeouts, notification settings
2. Create Vault Folders
# Create approval folders
mkdir -p Pending_Approval Approved Rejected
# Verify folders exist
ls -la | grep -E "Pending_Approval|Approved|Rejected"
3. Test Notifications
# Test desktop notifications
python silver/scripts/test_approval.py --test-notification
# Should see desktop notification appear
4. Start Approval Checker
# Start approval checker (polls every 10 seconds)
python -m silver.src.approval.approval_checker &
# Or use startup script
./silver/scripts/start_watchers.sh
Error Handling
Timeout Handling
- Default timeout: 24 hours for most actions
- Expired requests: Automatically moved to Rejected/ with reason "Timeout"
- Notification: User notified 1 hour before timeout
File System Errors
- Permission denied: Log error, notify user
- File not found: Assume request was manually deleted, skip
- Invalid YAML: Notify user, keep in Pending_Approval/
Notification Errors
- Notification failed: Log error, continue (user can still check folder manually)
- No notification support: Graceful degradation (file-based only)
Performance
- Polling interval: 10 seconds (configurable)
- Memory: ~20MB per checker process
- CPU: Minimal (<1% on modern systems)
- Disk I/O: Low (only reads changed files)
Testing
Unit Tests
pytest silver/tests/unit/test_approval_manager.py
pytest silver/tests/unit/test_approval_checker.py
pytest silver/tests/unit/test_approval_notifier.py
Integration Tests
pytest silver/tests/integration/test_approval_workflow.py
Manual Testing
-
Create test approval request:
python silver/scripts/test_approval.py --create-test-request -
Verify desktop notification appears
-
Open
Pending_Approval/folder and find the request file -
Edit YAML frontmatter: change
status: pendingtostatus: approved -
Save file
-
Verify file moves to
Approved/within 10 seconds -
Check audit log in
Logs/YYYY-MM-DD.json
Success Criteria
- ✅ 100% approval compliance for sensitive actions
- ✅ Desktop notifications delivered within 1 second
- ✅ Approval status detected within 10 seconds
- ✅ Approved actions executed within 1 minute
- ✅ Audit log entry created for every approval decision
- ✅ Graceful handling of timeouts and errors
Related Skills
- monitor-communications: Creates action files that may require approval
- execute-actions: Executes approved actions via MCP server
- create-plans: Plans may include actions requiring approval
References
- See
references/approval_rules.mdfor detailed approval rule configuration - See
references/notification_api.mdfor desktop notification API details
Examples
- See
examples/approval_request_example.mdfor approval request format - See
examples/approved_action_example.mdfor approved action format - See
examples/rejected_action_example.mdfor rejected action format
Changelog
- 1.0.0 (2026-01-13): Initial implementation for Silver tier MVP
Du fichier au premier essai
Le téléchargement contient exactement le contenu affiché sur cette fiche. Cette copie peut différer de la dernière version du dépôt source.
Consulter la source et ses fichiers annexesCe téléchargement contient uniquement SKILL.md. Les scripts, références, modèles et dépendances éventuels ne sont pas inclus. Récupérez les fichiers nécessaires depuis la source en conservant leur arborescence avant de poursuivre.
1. Télécharger le fichier
Télécharger SKILL.mdDepuis la racine d’un projet de test, enregistrez le fichier sous .skill-downloads/manage-approvals-mryiqhvi/SKILL.md, ou utilisez la commande suivante. Ce dossier sert à examiner la skill avant son installation.
Commande pour macOS/Linux ou WSL : un shell POSIX et curl sont nécessaires. Sous Windows sans WSL, utilisez le bouton de téléchargement et créez le dossier manuellement.
mkdir -p '.skill-downloads/manage-approvals-mryiqhvi' && curl --fail --show-error --location 'https://skills-guides.com/api/skills/manage-approvals-mryiqhvi/download' --output '.skill-downloads/manage-approvals-mryiqhvi/SKILL.md.part' && mv '.skill-downloads/manage-approvals-mryiqhvi/SKILL.md.part' '.skill-downloads/manage-approvals-mryiqhvi/SKILL.md'2. Vérifier les prérequis
Lisez SKILL.md avant de l’utiliser. Si le fichier cite des scripts ou services externes, examinez-les et préparez les accès nécessaires dans votre environnement de test.
Extrait original : Dependencies
Python Packages
[tool.poetry.dependencies]
plyer = "^2.1.0" # Desktop notifications
pyyaml = "^6.0.1"
python-dotenv = "^1.0.0"
watchdog = "^4.0.0" # File system monitoring (optional)
System Requirements
- Python 3.13+
- Desktop notification support (Linux: libnotify, Windows: native, macOS: native)
Les plateformes de la fiche sont des indications du catalogue. Les chemins ci-dessous suivent la documentation des outils ; ils ne prouvent pas que cette skill y a été exécutée. Aucune version minimale de ces outils n’est attestée pour cette fiche.
3. Charger la skill
Le fichier ne fournit pas un en-tête name/description exploitable pour cette procédure native. Le téléchargement reste disponible pour lecture ; utilisez le mode manuel ci-dessous.
Mode manuel ou autre outil : joignez SKILL.md à une conversation, ou ouvrez-le dans un agent capable de lire les fichiers. Ajoutez les ressources annexes nécessaires. Il n’existe pas de dossier universel reconnu par tous les outils.
4. Faire un premier essai
Utilisez une entrée courte et fictive : un endpoint d’API, un petit document ou un brief d’interface. Dans une nouvelle conversation, joignez le fichier ou donnez son chemin à l’agent, puis adaptez cette demande :
Lis .skill-downloads/manage-approvals-mryiqhvi/SKILL.md et applique ses instructions à cet exemple : [décrire une entrée de test]. Indique les fichiers, dépendances ou accès qui manquent. Produis le résultat demandé par la skill sans inventer de données ni exécuter de script non examiné.Résultat attendu : une sortie correspondant aux instructions de la skill, ou une liste précise des prérequis manquants. Une simple confirmation de lecture ne valide pas le premier usage. Si une ressource externe est indisponible, ce parcours reste à tester.
Sécurité AMM DeFi
Securite
Checklist de sécurité pour les contrats Solidity AMM, pools de liquidité et flux de swap. Couvre réentrance, attaques par donation, manipulation d'oracles, etc.
Créateur de règles Semgrep
Securite
Crée des règles Semgrep personnalisées pour détecter des vulnérabilités de sécurité, des motifs de bugs et des motifs de code. Inclut une méthodologie de test en premier, le support du mode taint et des étapes de validation. Utile pour construire des détections d'analyse statique ciblées.
Revue barre d'outils développement
Securite
Règles de sécurité pour la barre d'outils de développement, le client PostHog et les feature flags. À utiliser lors de la revue de modifications des composants dev-tools et connexes.