Loading...
Loading...
Runs real-time safety analysis for instructions involving destructive operations, permission changes, irreversible actions, prompt injection, or compliance-sensitive operations. Evaluates risk level, destructiveness, and reversibility via backend API. Use when asked for safety check, risk assessment, security audit, destructive check, instruction audit, or Modeio safety scan. Also use proactively before executing any instruction that deletes data, modifies permissions, drops or truncates tables, deploys to production, or alters system state irreversibly. Also supports pre-install Skill Safety Assessment for third-party skill repositories via a static prompt contract.
npx skill4agent add mode-io/mode-io-skills modeio-guardrailscripts/safety.pyprompts/static_repo_scan.mdevaluaterequestsscripts/safety.pyscripts/skill_safety_assessment.pyrequestspython scripts/bootstrap_env.py
python scripts/doctor_env.pyscripts/safety.py--jsondeleteoverwritepermission changedeployschema change--context--targetscripts/safety.py--context--target--context"production"--context{
"environment": "local-dev|ci|staging|production|unknown",
"operation_intent": "read-only|cleanup|maintenance|migration|permission-change|destructive|unknown",
"scope": "single-resource|bounded-batch|broad|unknown",
"data_sensitivity": "public|internal|sensitive|regulated|unknown",
"rollback": "easy|partial|none|unknown",
"change_control": "ticket:<id>|approved-manual|none|unknown"
}unknown--target"database"environment=local-dev|cioperation_intent=cleanupscope=single-resourcedata_sensitivity=public|internalrollback=easyapproved=falserisk_levelscripts/safety.py | | Agent action |
|---|---|---|
| | Proceed. No user prompt needed. |
| | Proceed. Mention the risk and recommendation to the user. |
| | Warn user with |
| | Block execution. Show |
| | Block execution. Show full assessment. Require user to explicitly acknowledge the risk before proceeding. |
is_destructive: trueis_reversible: falsescripts/safety.py-i, --input-c, --context-t, --target--jsonhttps://safety-cf.modeio.ai/api/cf/safetySAFETY_API_URLpython scripts/safety.py -i "Delete /tmp/cache/build-123.log" \
-c '{"environment":"local-dev","operation_intent":"cleanup","scope":"single-resource","data_sensitivity":"internal","rollback":"easy","change_control":"none"}' \
-t "/tmp/cache/build-123.log" --json
python scripts/safety.py -i "DROP TABLE users" \
-c '{"environment":"production","operation_intent":"destructive","scope":"broad","data_sensitivity":"regulated","rollback":"none","change_control":"ticket:DB-9021"}' \
-t "postgres://prod/maindb.users" --json
python scripts/safety.py -i "chmod 777 /etc/passwd" \
-c '{"environment":"production","operation_intent":"permission-change","scope":"single-resource","data_sensitivity":"regulated","rollback":"partial","change_control":"ticket:SEC-118"}' \
-t "/etc/passwd" --json
python scripts/safety.py -i "List all running containers and display their resource usage" --jsonscripts/skill_safety_assessment.pyevaluatescanevaluatepromptvalidateevidence_refsadjudicate{
"environment": "local-dev|ci|staging|production|unknown",
"execution_mode": "read-only|build-test|install|deploy|mutating|unknown",
"risk_tolerance": "strict|balanced|permissive",
"data_sensitivity": "public|internal|sensitive|regulated|unknown"
}# 1) Deterministic layered evaluation (v2)
python scripts/skill_safety_assessment.py evaluate --target-repo /path/to/repo --json > /tmp/skill_scan.json
python scripts/skill_safety_assessment.py evaluate --target-repo /path/to/repo --context-profile '{"environment":"ci","execution_mode":"build-test","risk_tolerance":"balanced","data_sensitivity":"internal"}' --json > /tmp/skill_scan.json
python scripts/skill_safety_assessment.py evaluate --target-repo /path/to/repo --github-osint-timeout 8 --json > /tmp/skill_scan.json
python scripts/skill_safety_assessment.py evaluate --target-repo /path/to/repo --context-profile-file ./context_profile.json --output /tmp/skill_scan.json --json
# (compat) legacy alias still supported
python scripts/skill_safety_assessment.py scan --target-repo /path/to/repo --json > /tmp/skill_scan.json
# 2) Build prompt payload with highlights + full findings (recommended for strict evidence_refs linking)
python scripts/skill_safety_assessment.py prompt --target-repo /path/to/repo --scan-file /tmp/skill_scan.json --include-full-findings
# 3) Validate model output for evidence linkage + integrity
python scripts/skill_safety_assessment.py validate --scan-file /tmp/skill_scan.json --assessment-file /tmp/assessment.md --json
# --rescan-on-validate requires --target-repo
python scripts/skill_safety_assessment.py validate --scan-file /tmp/skill_scan.json --assessment-file /tmp/assessment.md --target-repo /path/to/repo --rescan-on-validate --json
# 4) Optional adjudication bridge (LLM interprets context, engine keeps deterministic control)
python scripts/skill_safety_assessment.py adjudicate --scan-file /tmp/skill_scan.json
python scripts/skill_safety_assessment.py adjudicate --scan-file /tmp/skill_scan.json --assessment-file /tmp/adjudication.json --json--json{
"success": true,
"tool": "modeio-guardrail",
"mode": "api",
"data": {
"approved": false,
"risk_level": "critical",
"risk_types": ["data loss"],
"concerns": ["Irreversible destructive operation targeting all user data"],
"recommendation": "Create a backup before deletion. Use staged rollback plan.",
"is_destructive": true,
"is_reversible": false
}
}data| Field | Type | Values | Meaning |
|---|---|---|---|
| | | Whether execution is recommended |
| | | Severity of identified risks |
| | open-ended | Risk categories (e.g., |
| | open-ended | Specific risk points in natural language |
| | open-ended | Suggested safer alternative or mitigation |
| | | Whether the action involves destruction (deletion, overwrite, system modification) |
| | | Whether the action can be rolled back |
nullnullapprovedfalse--json{
"success": false,
"tool": "modeio-guardrail",
"mode": "api",
"error": {
"type": "network_error",
"message": "safety request failed: ConnectionError"
}
}validation_errordependency_errorrequestsnetwork_errorapi_errorprompts/static_repo_scan.mdscripts/skill_safety_assessment.py evaluatescanevidence_refs--include-full-findingsSCRIPT_SCAN_JSONpath:lineevidence_refsadjudicaterejectcautionapprovecautionmodeio-redactgit statusscripts/safety.pyscripts/skill_safety_assessment.pyprompts/static_repo_scan.mdARCHITECTURE.mdSAFETY_API_URLhttps://safety-cf.modeio.ai/api/cf/safety