[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7B38H0Z1F101Q2EZEVKCSD7":3,"skill-same:01M7B38H0Z1F101Q2EZEVKCSD7":45},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":18,"linkOnly":19,"markdownContent":20,"markdownBody":21,"frontMatter":22,"refName":23,"commitSha":24,"skillDirectory":25,"forksCount":13,"repositoryHtmlUrl":26,"repositoryHomepageUrl":6,"ownerHtmlUrl":27,"ownerBlogUrl":28,"ownerDescription":29,"updatedAt":30,"install":31,"resources":44},"01M7B38H0Z1F101Q2EZEVKCSD7","agentmon-policy-create",null,"Use when creating a new AgentMon security policy, including agent sandboxes, CI pipelines, development environments, HTTP service gateways, or Postgres-family database access policies","diffsec\u002Fagentmon","diffsec","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F270286144?v=4","01M7B382NCCWYC6H5TXSK3VKKA","01M7B382P2M9S2BQ3PSYDTHPM7",0,"Apache-2.0","https:\u002F\u002Fgithub.com\u002Fdiffsec\u002Fagentmon\u002Fblob\u002Fmain\u002Fskills\u002Fagentmon-policy-create\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: agentmon-policy-create\ndescription: Use when creating a new AgentMon security policy, including agent sandboxes, CI pipelines, development environments, HTTP service gateways, or Postgres-family database access policies\n---\n\n# Create AgentMon Policy\n\n## Overview\n\nCreate new AgentMon 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.\n\n## When to Use\n\n- User asks to create\u002Fmake\u002Fgenerate a new policy\n- User describes a use case that needs a policy (\"policy for my CI pipeline\")\n- User wants to set up AgentMon for the first time\n- User wants controlled access to a declared HTTP API or Postgres-family database\n- NOT for editing existing policies (use agentmon-policy-edit)\n\n## Flow\n\n1. **Locate policy directory**\n   - Look for `config.yml` or `config.yaml` in the project root to find `policies.dir`\n   - If not found, look for a `configs\u002Fpolicies\u002F` directory\n   - Fall back to asking the user with AskUserQuestion\n\n2. **Understand the use case**\n   Use AskUserQuestion to ask: \"What will this policy protect?\"\n\n   | Use Case | Template |\n   |----------|----------|\n   | AI agent (code tasks) | `default` or `agent-default` |\n   | CI\u002FCD pipeline | `ci-strict` |\n   | Local development | `dev-safe` |\n   | Strict agent sandbox | `agent-sandbox` |\n   | Observation\u002Fprofiling | `agent-observe` |\n   | Declared HTTP API gateway | Start from `default` |\n   | Postgres-family database access | Start from `default` |\n   | Custom \u002F other | Start from `default` |\n\n3. **Select template**\n   - Read the matching template from the policy directory (e.g., `configs\u002Fpolicies\u002Fdefault.yaml`)\n   - On Windows, prefer the `-windows` variant if available (e.g., `default-windows.yaml`, `ci-strict-windows.yaml`)\n   - If templates are not available locally, use the schema reference to generate a baseline\n\n4. **Customize**\n   Based on the template read in Step 3, ask only about gaps — skip categories the template already handles well:\n   - \"Which domains does your app need to reach?\" → add network rules\n   - \"Any paths outside the workspace it needs?\" → add file rules\n   - \"Any commands to block or require approval?\" → add command rules\n   - \"Should any HTTP APIs be exposed through AgentMon?\" → add `http_services` plus `providers` when credential substitution is needed\n   - \"Should any Postgres-family databases be mediated?\" → add `db_services`, `database_connection_rules`, `database_rules`, and `policies.db`\n\n   For database policies, ask for:\n   - service name, dialect (`postgres`, `aurora_postgres`, `redshift`, `cockroachdb`), upstream `host:port`, and `tls_mode`\n   - connection constraints: DB user, database name, application name, replication\u002Fcancel handling\n   - statement intent: read\u002Fwrite\u002Fadmin operations, schemas\u002Fobjects, catalog selectors (`relations`, `functions`) if known\n   - redaction preference: `policies.db.log_statements`, `approval_statement_preview`, and `approval_statement_preview_chars`\n   - unavoidability posture: `off`, `observe`, or `enforce`\n\n5. **Name & write**\n   - Ask for a policy name\n   - Generate the YAML with descriptive section comments matching built-in policy style\n   - Write to the policy directory\n\n6. **Validate**\n   Run: `agentmon policy validate \u003Cname>`\n   If validation fails, fix and re-validate.\n   If `agentmon` binary is not available, warn the user to validate manually.\n\n7. **Update config reminder**\n   If `config.yml` has a `policies.allowed` list, remind the user to add the new policy name.\n\n## Guardrails\n\n- Always use `version: 1`\n- Every policy must have `name` and `description`\n- End rule-list categories (file_rules, network_rules, command_rules) with a default-deny catch-all\n- Use descriptive rule names in `verb-noun` format (e.g., `allow-npm`, `deny-ssh-keys`)\n- Include section comment headers matching built-in policy style\n- First match wins — place specific rules before general ones\n- Do not invent runtime support for non-Postgres databases. Current DB enforcement is Postgres-family only.\n- For `http_services`, prefer path\u002Fmethod rules over broad network allows when the user needs audited API surface control.\n- For `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.\n- For Postgres `UPDATE`\u002F`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\u002For `delete`; explain that it is syntactic, `WHERE true` still satisfies it, and another unguarded non-deny rule can still cover the same effect.\n- For DB `redirect`, only author safe read-only Postgres relation replacement: one canonical source in `relations`, `match_object_resolution: catalog_resolved`, and `redirect.relation`.\n\n## Schema Reference\n\nRead `skills\u002Fagentmon-policy-shared\u002Fschema-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.\n","# Create AgentMon Policy\n\n## Overview\n\nCreate new AgentMon 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.\n\n## When to Use\n\n- User asks to create\u002Fmake\u002Fgenerate a new policy\n- User describes a use case that needs a policy (\"policy for my CI pipeline\")\n- User wants to set up AgentMon for the first time\n- User wants controlled access to a declared HTTP API or Postgres-family database\n- NOT for editing existing policies (use agentmon-policy-edit)\n\n## Flow\n\n1. **Locate policy directory**\n   - Look for `config.yml` or `config.yaml` in the project root to find `policies.dir`\n   - If not found, look for a `configs\u002Fpolicies\u002F` directory\n   - Fall back to asking the user with AskUserQuestion\n\n2. **Understand the use case**\n   Use AskUserQuestion to ask: \"What will this policy protect?\"\n\n   | Use Case | Template |\n   |----------|----------|\n   | AI agent (code tasks) | `default` or `agent-default` |\n   | CI\u002FCD pipeline | `ci-strict` |\n   | Local development | `dev-safe` |\n   | Strict agent sandbox | `agent-sandbox` |\n   | Observation\u002Fprofiling | `agent-observe` |\n   | Declared HTTP API gateway | Start from `default` |\n   | Postgres-family database access | Start from `default` |\n   | Custom \u002F other | Start from `default` |\n\n3. **Select template**\n   - Read the matching template from the policy directory (e.g., `configs\u002Fpolicies\u002Fdefault.yaml`)\n   - On Windows, prefer the `-windows` variant if available (e.g., `default-windows.yaml`, `ci-strict-windows.yaml`)\n   - If templates are not available locally, use the schema reference to generate a baseline\n\n4. **Customize**\n   Based on the template read in Step 3, ask only about gaps — skip categories the template already handles well:\n   - \"Which domains does your app need to reach?\" → add network rules\n   - \"Any paths outside the workspace it needs?\" → add file rules\n   - \"Any commands to block or require approval?\" → add command rules\n   - \"Should any HTTP APIs be exposed through AgentMon?\" → add `http_services` plus `providers` when credential substitution is needed\n   - \"Should any Postgres-family databases be mediated?\" → add `db_services`, `database_connection_rules`, `database_rules`, and `policies.db`\n\n   For database policies, ask for:\n   - service name, dialect (`postgres`, `aurora_postgres`, `redshift`, `cockroachdb`), upstream `host:port`, and `tls_mode`\n   - connection constraints: DB user, database name, application name, replication\u002Fcancel handling\n   - statement intent: read\u002Fwrite\u002Fadmin operations, schemas\u002Fobjects, catalog selectors (`relations`, `functions`) if known\n   - redaction preference: `policies.db.log_statements`, `approval_statement_preview`, and `approval_statement_preview_chars`\n   - unavoidability posture: `off`, `observe`, or `enforce`\n\n5. **Name & write**\n   - Ask for a policy name\n   - Generate the YAML with descriptive section comments matching built-in policy style\n   - Write to the policy directory\n\n6. **Validate**\n   Run: `agentmon policy validate \u003Cname>`\n   If validation fails, fix and re-validate.\n   If `agentmon` binary is not available, warn the user to validate manually.\n\n7. **Update config reminder**\n   If `config.yml` has a `policies.allowed` list, remind the user to add the new policy name.\n\n## Guardrails\n\n- Always use `version: 1`\n- Every policy must have `name` and `description`\n- End rule-list categories (file_rules, network_rules, command_rules) with a default-deny catch-all\n- Use descriptive rule names in `verb-noun` format (e.g., `allow-npm`, `deny-ssh-keys`)\n- Include section comment headers matching built-in policy style\n- First match wins — place specific rules before general ones\n- Do not invent runtime support for non-Postgres databases. Current DB enforcement is Postgres-family only.\n- For `http_services`, prefer path\u002Fmethod rules over broad network allows when the user needs audited API surface control.\n- For `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.\n- For Postgres `UPDATE`\u002F`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\u002For `delete`; explain that it is syntactic, `WHERE true` still satisfies it, and another unguarded non-deny rule can still cover the same effect.\n- For DB `redirect`, only author safe read-only Postgres relation replacement: one canonical source in `relations`, `match_object_resolution: catalog_resolved`, and `redirect.relation`.\n\n## Schema Reference\n\nRead `skills\u002Fagentmon-policy-shared\u002Fschema-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.\n",{"name":5,"description":7},"main","230ac962f6875ed37cf882f30b1b0d41be89a08c","skills\u002Fagentmon-policy-create","https:\u002F\u002Fgithub.com\u002Fdiffsec\u002Fagentmon","https:\u002F\u002Fgithub.com\u002Fdiffsec","https:\u002F\u002Fdiffsec.dev","An open source research collective that aims to bring AI security tooling to everyone","2026-11-11 08:10:56",{"source":8,"skillName":5,"commands":32,"prompt":42,"zipAvailable":43},[33,36,39],{"tool":34,"command":35},"npx","npx skills add diffsec\u002Fagentmon --skill agentmon-policy-create",{"tool":37,"command":38},"bunx","bunx skills add diffsec\u002Fagentmon --skill agentmon-policy-create",{"tool":40,"command":41},"pnpm","pnpm dlx skills add diffsec\u002Fagentmon --skill agentmon-policy-create","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fdiffsec\u002Fagentmon\u002Fblob\u002Fmain\u002Fskills\u002Fagentmon-policy-create\u002FSKILL.md",true,[],[46,53,60,67,74,81],{"skillNo":47,"name":48,"nameZh":6,"description":49,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":50,"categories":51,"keywords":52,"publishedAt":18},"01M7B38KDFEJYPJQFWK6NY5C8S","agentmon-policy-edit","Use when adding, removing, or updating rules in an existing AgentMon policy, modifying security permissions, HTTP service declarations, Postgres-family database rules, resource limits, or policy YAML files","https:\u002F\u002Fgithub.com\u002Fdiffsec\u002Fagentmon\u002Fblob\u002Fmain\u002Fskills\u002Fagentmon-policy-edit\u002FSKILL.md",[],[],{"skillNo":54,"name":55,"nameZh":6,"description":56,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":57,"categories":58,"keywords":59,"publishedAt":18},"01M7B38FXPR8AQB54DRY6TYCZJ","with-allowed","Declares allowed tools","https:\u002F\u002Fgithub.com\u002Fdiffsec\u002Fagentmon\u002Fblob\u002Fmain\u002Finternal\u002Fskillcheck\u002Ftestdata\u002Fskills\u002Fwith-allowed\u002FSKILL.md",[],[],{"skillNo":61,"name":62,"nameZh":6,"description":63,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":64,"categories":65,"keywords":66,"publishedAt":18},"01M7B38ETGG8V9AVKNKB3C4N2V","scope-mismatch","declares read-only but writes","https:\u002F\u002Fgithub.com\u002Fdiffsec\u002Fagentmon\u002Fblob\u002Fmain\u002Finternal\u002Fskillcheck\u002Ftestdata\u002Fskills\u002Fscope-mismatch\u002FSKILL.md",[],[],{"skillNo":68,"name":69,"nameZh":6,"description":70,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":71,"categories":72,"keywords":73,"publishedAt":18},"01M7B38D8TR0NTNG0CPAT8JMAG","prompt-injection","prompt injection markers","https:\u002F\u002Fgithub.com\u002Fdiffsec\u002Fagentmon\u002Fblob\u002Fmain\u002Finternal\u002Fskillcheck\u002Ftestdata\u002Fskills\u002Fprompt-injection\u002FSKILL.md",[],[],{"skillNo":75,"name":76,"nameZh":6,"description":77,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":78,"categories":79,"keywords":80,"publishedAt":18},"01M7B38C7YAZF7J2MZ6WMK7WA3","oversized","Trips the per-file size limit","https:\u002F\u002Fgithub.com\u002Fdiffsec\u002Fagentmon\u002Fblob\u002Fmain\u002Finternal\u002Fskillcheck\u002Ftestdata\u002Fskills\u002Foversized\u002FSKILL.md",[],[],{"skillNo":82,"name":83,"nameZh":6,"description":84,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":85,"categories":86,"keywords":87,"publishedAt":18},"01M7B38B7BNE5TYHXMGG64266T","minimal","A minimal valid skill","https:\u002F\u002Fgithub.com\u002Fdiffsec\u002Fagentmon\u002Fblob\u002Fmain\u002Finternal\u002Fskillcheck\u002Ftestdata\u002Fskills\u002Fminimal\u002FSKILL.md",[],[]]