Registry Mirror
Skip to content

Conversation

@CarlosMion

@CarlosMion CarlosMion commented Nov 30, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Documents that a guarded environment's data sources (PUT and DELETE …/opal_scope) and URL mapping rules (POST, PATCH and DELETE …/proxy_configs) answer 403 Forbidden with the error code POLICY_GUARD_PROTECTED, for every caller allowed to make the request. GET still works.
  • Documents that, in a project with a guarded environment, a request that changes the policy source answers the same 403: activating another repository, disabling the active one, creating a repository with activate_when_validated: true, deleting a repository that a project with a guarded environment uses, and a project PATCH that changes active_policy_repo_id.
  • Documents the way out for both (remove the project from the Policy Guard scope, make the change, add the project back), and that replacing a data source or proxy credential, or a repository's deploy key, needs it too.
  • Adds the same refusal to the Permit CLI pages for permit api create proxy, permit env apply openapi (its URL mappings) and permit gitops create github.

Merge this after the matching backend release reaches production.

Changes

File Change
docs/how-to/policy-guard/policy_guard.mdx Two bullets under "How Permit applies a Policy Guard": the environment's data sources and URL mapping rules are locked, and the project's policy source is locked, each with the refused requests and the way out. The error-code paragraph names the refusals that carry POLICY_GUARD_PROTECTED (environment record, data sources, URL mapping rules, policy source, project and organization delete), and says a refused guarded permission carries FORBIDDEN_ACCESS.
docs/how-to/manage-data/use-external-data-source.mdx A note under "Add the data source to the OPAL scope" on the 403 in a guarded environment.
docs/how-to/enforce-permissions/url-mapping/regex-url-mapping-check.mdx A note under "Create a regex mapping rule with the API" on the 403 in a guarded environment.
docs/how-to/enforce-permissions/url-mapping/url-mapping-check.mdx One sentence: mapping rules can't be changed in a guarded environment, in the dashboard or with the API.
docs/integrations/gitops/github.mdx Step 3, "Activate the repository": the activation fails with the 403 when the project has a guarded environment.
docs/how-to/permit-cli/permit-cli-gitops.mdx permit gitops create github without --inactive fails with the 403 on such a project; with --inactive, the later activation does.
docs/how-to/permit-cli/permit-cli-api.mdx permit api create proxy: Permit refuses the proxy configuration with the 403 in a guarded environment.
docs/how-to/permit-cli/permit-cli-policy.mdx "URL mappings that the command creates": in a guarded environment, Permit refuses the URL mappings with the 403; the command still creates the policy objects, then prints the mapping error.

Checks

  • node scripts/check-relative-links.mjs and node scripts/check-private-paths.mjs pass.
  • Prettier 2.8.8 (the ^2.7.1 range in package.json) reformats each changed file exactly as much as it reformats master's copy: the new lines add nothing to format.
  • Every link target exists, and #how-permit-applies-a-policy-guard is an explicit anchor on the Policy Guard page. The full npm run build (with hyperlink --check-anchors) runs in the Netlify deploy preview.

Description updated during review to match 30f25c6 (added the two Permit CLI pages to Summary and Changes, and the scoped error-code paragraph).

🤖 Generated with Claude Code

…nd the policy source

In a guarded environment, the OPAL scope data sources and the proxy configs (URL mapping rules) can't be written. In a project with a guarded environment, a request that changes the policy source (activate, disable, create with activate_when_validated, delete of an active repository, PATCH of active_policy_repo_id) is refused. Notes on the data source, URL mapping and GitOps pages link to the Policy Guard page.
Copilot AI balanced review requested due to automatic review settings November 30, 2026 08:56
@CarlosMion CarlosMion self-assigned this Nov 30, 2026
@CarlosMion
CarlosMion requested a review from zeevmoney November 30, 2026 08:56
@netlify

netlify Bot commented Nov 30, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for permitio-docs ready!

Name Link
🔨 Latest commit b6c5e94
🔍 Latest deploy log https://app.netlify.com/projects/permitio-docs/deploys/6b0d4af10d794d5c942e0ec2
😎 Deploy Preview https://deploy-preview-701--permitio-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@linear-code

linear-code Bot commented Nov 30, 2026

Copy link
Copy Markdown

PER-17991

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

@zeevmoney zeevmoney left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes requested — 1 HIGH, 1 MEDIUM, 2 LOW.

Blocking:

  • HIGH docs/how-to/policy-guard/policy_guard.mdx:46 — the error-code sentence now covers guarded-permission refusals, which return FORBIDDEN_ACCESS

Non-blocking:

  • MEDIUM docs/how-to/enforce-permissions/url-mapping/url-mapping-check.mdx:58 — permit env apply openapi and permit api create proxy pages don't mention the refusal
  • LOW docs/integrations/gitops/github.mdx:157 — the short notes say to remove the project from the scope, but not to add it back
  • LOW docs/how-to/policy-guard/policy_guard.mdx:44 — the way out names only "the project", but a repository delete is checked against every project that uses it

Details are in the inline comments on each line.

Comment thread docs/integrations/gitops/github.mdx Resolved
…ll way out

The POLICY_GUARD_PROTECTED sentence names the refusals that carry it; a refused change to a guarded permission has FORBIDDEN_ACCESS. permit env apply openapi and permit api create proxy get the same 403 on a guarded environment. Each note gives the full way out (remove the project from the scope, make the change, add it back), and a repository delete names every project that uses the repository.
@CarlosMion

Copy link
Copy Markdown
Contributor Author

@zeevmoney all four are fixed in 30f25c6. Three threads went outdated with the push, so I resolved them; here is what changed for each:

  • HIGH, policy_guard.mdx:46, the error code: the sentence now names the refusals that carry POLICY_GUARD_PROTECTED (a guarded environment's record, data sources or URL mapping rules, a project's policy source, and a project or organization delete). A new sentence says a refused change to a permission that a Policy Guard rule covers has FORBIDDEN_ACCESS, the same code as any other permissions 403.
  • LOW, github.mdx:157, the way out: every short note now gives the full sequence: remove the project from the scope, make the change (or activate the repository), then add the project back. That covers github.mdx, use-external-data-source.mdx, regex-url-mapping-check.mdx and permit-cli-gitops.mdx.
  • LOW, policy_guard.mdx:44, the repository delete: the lead-in reads "A request that changes the policy source of a project with a guarded environment fails…", and the way out says that for a repository delete, every project whose active repository it is comes out of the scope.
  • MEDIUM, the CLI pages: answered on its thread.

@CarlosMion
CarlosMion requested a review from zeevmoney November 30, 2026 09:27

@zeevmoney zeevmoney left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved — no CRITICAL or HIGH issues found.

Non-blocking:

  • MEDIUM docs/how-to/policy-guard/policy_guard.mdx:46 — most permissions 403 responses have no error code, so "the same code as any other permissions 403" is wrong

All four findings from the previous review are fixed (replies on each thread).

Details are in the inline comments on each line.

Comment thread docs/integrations/gitops/github.mdx Resolved
A plain permissions 403 carries no error code, so the guarded-permission refusal is told apart by FORBIDDEN_ACCESS, not POLICY_GUARD_PROTECTED, rather than compared with it.
@CarlosMion

Copy link
Copy Markdown
Contributor Author

@zeevmoney fixed in b6c5e94: the sentence now reads "A refused change to a permission that a Policy Guard rule covers has the error code FORBIDDEN_ACCESS, not POLICY_GUARD_PROTECTED." This also corrects my earlier summary comment, which repeated the "same code as any other permissions 403" claim.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants