Skip to content

docs: add policy.yaml operator cheatsheet #1

Description

@CodewithJha

👋 New to open source?
Thanks for considering contributing to Mutiny.
This issue is intentionally beginner-friendly.
If you get stuck, ask questions in the comments.
We're happy to help.

Context

Mutiny policies are deterministic tool-use invariants (not LLM judges). Operators live in Core and are exercised in unit tests, but newcomers have no one-page reference for writing policy.yaml.

Goal

Add a short operator cheatsheet under docs/ so a contributor can write or read a policy without digging through Core source.

Why it matters

The sample policy and tests are the real source of truth today. A cheatsheet lowers the barrier for docs PRs, example packs, and first adapters.

Acceptance criteria

  • Add docs/POLICY_CHEATSHEET.md listing supported operators / rule kinds with short examples drawn from tests/unit/test_policy_*.py and examples/openai_support_agent/policy.yaml
  • Link it from the document map in docs/README.md
  • No Core / policy language redesign and no behavior changes
  • PR description links this issue

Suggested files

  • docs/POLICY_CHEATSHEET.md (new)
  • docs/README.md (map link)
  • Read-only: tests/unit/test_policy_*.py, examples/openai_support_agent/policy.yaml

Out of scope

  • Changing evaluator semantics, adding new operators, or redesigning Hosted policy UI

Hints

  • Start from rule kind values (require_args, forbid_args, deny_tool) and constraint ops used in tests (eq, gt, context paths).
  • Keep examples copy-paste tiny (3–8 lines each). Prefer tables + fenced YAML.
  • After drafting: uv run pytest tests/unit/test_policy_evaluator.py -q should still pass unchanged.

Difficulty

S · docs only · ~half day

Docs

Metadata

Metadata

Assignees

No one assigned

    Labels

    docsDocumentation improvementsgood first issueGood for newcomers

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions