Skip to content

deterministic and unique namespace fallback for unconfigured policy files - #3

Merged
YosiElias merged 1 commit into
masterfrom
feat/deterministic-default-namespace-fallback
Jun 29, 2026
Merged

YosiElias merged 1 commit into
masterfrom
feat/deterministic-default-namespace-fallback

Conversation

@YosiElias

Copy link
Copy Markdown
Collaborator

Summary

  • Auto-derive a deterministic default namespace (opg-{repo}-{user}) when openshift-policy.yaml has no namespaces configured, giving new users a working setup without manual policy editing
  • Add derive_default_ns() to the hook with full sanitization (lowercase, special char replacement, length caps) to stay within Kubernetes' 63-char namespace limit
  • Ship openshift-policy.example.yaml so users can see the permission model without touching the live policy
  • Clear openshift-policy.yaml of sample namespaces so the default derivation activates out of the box
  • Add 21 new tests covering default namespace permissions, function alignment between hook and README, and sanitization edge cases

Security note

The README explains why the agent must never read or edit the policy file directly. The derivation logic resides within the hook (which the agent cannot modify), and a copy of this function is embedded in the target skill prompts so that both sides deterministically compute the namespace—preserving the security boundary between the agent and its constraints.

…licy files

Signed-off-by: Yossi Elias <yelias@redhat.com>
@YosiElias
YosiElias merged commit 795fca3 into master Jun 29, 2026
1 check passed
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.

1 participant