Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion dtwo/.claude-plugin/plugin.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "dtwo",
"version": "1.3.6",
"version": "1.3.7",
"description": "Manage Dtwo gateways, policies, and Rego with the Dtwo MCP server.",
"author": {
"name": "Dtwo",
Expand Down
2 changes: 1 addition & 1 deletion dtwo/.codex-plugin/plugin.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "dtwo",
"version": "1.3.6",
"version": "1.3.7",
"description": "Manage Dtwo gateways, policies, and Rego with the Dtwo MCP server.",
"author": {
"name": "Dtwo",
Expand Down
2 changes: 1 addition & 1 deletion dtwo/.cursor-plugin/plugin.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "dtwo",
"version": "1.3.6",
"version": "1.3.7",
"description": "Manage Dtwo gateways, policies, and Rego with the Dtwo MCP server.",
"author": {
"name": "Dtwo",
Expand Down
60 changes: 44 additions & 16 deletions dtwo/skills/dtwo-gateway-policy/SKILL.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dtwo/skills/dtwo-policy-rego/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ This skill is typically used alongside others. Invoke them via the `Skill` tool

## Core Rules

- **Keep each policy simple and focused on a single concern.** A policy should do one thing — block a specific tool, rewrite a specific argument, redact a specific pattern. Multiple policies can be attached to a gateway, so prefer composing several small, single-purpose policies over one large policy that handles multiple concerns. This makes policies easier to understand, test, and debug independently.
- **Keep each policy simple and focused on a single concern.** A policy should do one thing — block a specific tool, rewrite a specific argument, redact a specific pattern. Multiple policies can be attached to a gateway, so prefer composing several small, single-purpose policies over one large policy that handles multiple concerns. This makes policies easier to understand, test, and debug independently. When one outcome needs several of them working together (a marker writer and its reader, for example), they are saved in one policy group; the companion `dtwo-gateway-policy` skill covers that step (Policy Groups).
- Every policy must declare a `package` name following the convention `<tool>.<direction>.<purpose>` — where `<tool>` is the MCP server (e.g., `jira`, `slack`), `<direction>` is `ingress` or `egress`, and `<purpose>` describes the policy's intent (e.g., `readonly`, `deny_comment`, `pii_redaction`). If the policy is not tool-specific, the tool segment can be omitted (e.g., `egress.pii_redaction`). If the user does not supply a name, choose one based on this convention
- Choose the `default allow` value by the policy's **primary job**. An **access-control** policy whose default stance is to block should default to deny (`default allow := false`) and enumerate `allow` rules. A policy that only **transforms** (PII redaction, query rewriting) or that **allows broadly and denies a specific condition** (e.g. a marker/intent reader that blocks one tool when a signal is set) should use `default allow := true` with targeted `allow := false if { ... }` rules — this avoids needing an explicit `allow` for every unrelated tool. Both are valid; see "Valid Rego Patterns (Not Bugs)" for the `default allow := true` + `allow := false if` shape
- Use **separate top-level rules** for `allow`, `reasons`, `reason`, and `transform` — do NOT return structured decision objects
Expand Down
12 changes: 9 additions & 3 deletions dtwo/skills/dtwo-policy-rego/references/policy-store-catalog.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ bundles/
<bundle>/
README.md

groups/
<group>/
README.md

manifest.json
schema.json
```
Expand All @@ -36,6 +40,7 @@ schema.json
- Use `<policy-slug>` as the lowercase, hyphenated purpose, such as `block-secrets`, `readonly`, or `pii-redaction`.
- Do not add per-policy `README.md` or `metadata.json` files. Human documentation and all metadata live in `policy.md` frontmatter.
- Treat `manifest.json` as generated from policy frontmatter. Do not hand-edit it except through the manifest generator.
- Policy groups work like bundles: a policy lists its group slugs under `groups` in its frontmatter, and each group has a `groups/<group>/README.md` whose frontmatter holds the group's `name` and an optional `description`. The directory name is the group's id. A group needs at least two policies.

### `policy.md`

Expand All @@ -51,7 +56,7 @@ Frontmatter must include the required schema fields from `schema.json`:
- `apps`
- `schemaVersion`

Include `industries`, `bundles`, and `minimumGatewayVersion` when they apply. Put the policy's human-facing documentation in `description`: what it does, when to use it, assumptions, limitations, examples, and relevant composition notes.
Include `industries`, `bundles`, `groups`, and `minimumGatewayVersion` when they apply. Put the policy's human-facing documentation in `description`: what it does, when to use it, assumptions, limitations, examples, and relevant composition notes.

Catalog policies are stricter than tenant-local examples:

Expand Down Expand Up @@ -93,7 +98,8 @@ Each test case uses this shape:
2. Add a row or link to `apps/<app>/README.md`.
3. If the policy belongs to an industry or bundle, list the slug in `policy.md` frontmatter and add a link from the matching `industries/<industry>/README.md` or `bundles/<bundle>/README.md`.
4. For new apps, industries, or bundles, create the corresponding directory and `README.md`.
5. Run `pnpm manifest`, commit the generated `manifest.json`, then run `pnpm manifest:check`.
6. Run `pnpm test`; it requires the OPA CLI on `PATH` or `OPA_BIN` set.
5. If the policy only works together with other policies (a marker writer and its reader, or a policy that blocks a passthrough tool and the per-tool policies it protects), list their group slug under `groups` in each policy's frontmatter. For a new group, also create `groups/<group>/README.md` with `name` and `description` frontmatter. Never rename a published group's directory, since accounts that imported the group stay linked by its id.
6. Run `pnpm manifest`, commit the generated `manifest.json`, then run `pnpm manifest:check`. The check also fails when a policy lists a group with no directory, or a group has fewer than two policies.
7. Run `pnpm test`; it requires the OPA CLI on `PATH` or `OPA_BIN` set.

Do not invent new manifest fields. Match existing policy frontmatter and open an issue first if the schema lacks a needed field.