Skip to content

docs: describe policies in plain words + add a policies step to the DO tutorial - #9577

Merged
atlaie merged 3 commits into
devfrom
atlaie/policy-docs
Oct 26, 2026
Merged

atlaie merged 3 commits into
devfrom
atlaie/policy-docs

Conversation

@atlaie

@atlaie atlaie commented Oct 24, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Found while testing #9566 end to end in Colab: nothing tells a DO to describe a policy in plain words, although evaluators read its source, and the DO tutorial doesn't cover policies yet. Docs only.

Changes

  • docs/jobs.md: start every policy with a plain-words docstring; all examples have one. "Denying a call" says where the DS reads the reason (job.policy_error) and what it looks like for an uncaught exception, e.g. ValueError: Rate limit reached: 10 calls per 24 hours.
  • syft_job/policies/env.py: the Deny and Reason conventions match, plus a Describe convention. Docstring only.
  • DO tutorial, api step: config.yaml isn't matched by name (the DO writes it for each call), step numbers match the overview, and a new "Add an input policy" subsection writes, tests (run_policy) and attaches (set_policies) an allowed-dataset plus rate-limit policy.
  • DS tutorial, 11d: a DO's policy can refuse a call or hold its outputs back; the reason is in job.policy_error.
  • Cell ids after the new DO tutorial subsection shift because the repo's nbstripout hook renumbers them; metadata ids are unchanged.

Testing

  • Notebooks pass nbformat.validate; pre-commit passes.
  • The new policy cells were run against the branch code, set_policies on a throwaway api; the full DO notebook wasn't run end to end, because it needs Google sign-in.

Asana task

🤖 Generated with Claude Code

…orial

Deny with sys.exit("<message>") in the policy examples so the DS sees
just the message, start every policy with a plain-words docstring, add an
input-policy subsection to the DO tutorial's api step, fix its config.yaml
and step-number text, and tell the DS where a policy's reason shows up.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@review-notebook-app

Copy link
Copy Markdown

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

Comment thread docs/jobs.md Outdated
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@atlaie atlaie changed the title docs: plain-message policy examples and a policies step in the DO tutorial docs: describe policies in plain words and add a policies step to the DO tutorial Oct 26, 2026
@atlaie atlaie changed the title docs: describe policies in plain words and add a policies step to the DO tutorial docs: describe policies in plain words + add a policies step to the DO tutorial Oct 26, 2026
@atlaie
atlaie merged commit 23a3441 into dev Oct 26, 2026
23 checks passed
@atlaie
atlaie deleted the atlaie/policy-docs branch October 26, 2026 11:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants