com um clique
agentsh-policy-create
// Use when creating a new AgentSH security policy, including agent sandboxes, CI pipelines, development environments, HTTP service gateways, or Postgres-family database access policies
// Use when creating a new AgentSH security policy, including agent sandboxes, CI pipelines, development environments, HTTP service gateways, or Postgres-family database access policies
Use when adding, removing, or updating rules in an existing AgentSH policy, modifying security permissions, HTTP service declarations, Postgres-family database rules, resource limits, or policy YAML files
dangerous eval pattern
Has a source frontmatter field
hidden unicode tags
triggers multiple critical-severity rules
A minimal valid skill
| name | agentsh-policy-create |
| description | Use when creating a new AgentSH security policy, including agent sandboxes, CI pipelines, development environments, HTTP service gateways, or Postgres-family database access policies |
Create new AgentSH security policies from built-in templates, customized to the user's use case. Produces valid YAML policy files with correct structure, evaluation semantics, and defensive defaults for file, network, command, HTTP service, and Postgres-family database controls.
Locate policy directory
config.yml or config.yaml in the project root to find policies.dirconfigs/policies/ directoryUnderstand the use case Use AskUserQuestion to ask: "What will this policy protect?"
| Use Case | Template |
|---|---|
| AI agent (code tasks) | default or agent-default |
| CI/CD pipeline | ci-strict |
| Local development | dev-safe |
| Strict agent sandbox | agent-sandbox |
| Observation/profiling | agent-observe |
| Declared HTTP API gateway | Start from default |
| Postgres-family database access | Start from default |
| Custom / other | Start from default |
Select template
configs/policies/default.yaml)-windows variant if available (e.g., default-windows.yaml, ci-strict-windows.yaml)Customize Based on the template read in Step 3, ask only about gaps — skip categories the template already handles well:
http_services plus providers when credential substitution is neededdb_services, database_connection_rules, database_rules, and policies.dbFor database policies, ask for:
postgres, aurora_postgres, redshift, cockroachdb), upstream host:port, and tls_moderelations, functions) if knownpolicies.db.log_statements, approval_statement_preview, and approval_statement_preview_charsoff, observe, or enforceName & write
Validate
Run: agentsh policy validate <name>
If validation fails, fix and re-validate.
If agentsh binary is not available, warn the user to validate manually.
Update config reminder
If config.yml has a policies.allowed list, remind the user to add the new policy name.
version: 1name and descriptionverb-noun format (e.g., allow-npm, deny-ssh-keys)http_services, prefer path/method rules over broad network allows when the user needs audited API surface control.database_rules, remember DB evaluation is not simple first-match-wins: any matching deny wins, non-deny rules must cover every object slot, and uncovered objects fail closed.UPDATE/DELETE access to sensitive relations, ask whether accidental full-table mutation should be blocked. Use require_where: true only on rules whose operations expand exclusively to modify and/or delete; explain that it is syntactic, WHERE true still satisfies it, and another unguarded non-deny rule can still cover the same effect.redirect, only author safe read-only Postgres relation replacement: one canonical source in relations, match_object_resolution: catalog_resolved, and redirect.relation.Read skills/agentsh-policy-shared/schema-reference.md for the complete policy YAML schema before generating any policy content. If this file is not accessible, proceed using only the guardrails above plus the template file read in Step 3. Do not generate policy YAML without either the schema reference or a template.