Skip to content

Add OP-10 Principal and Tenant removal skill - #29

Merged
sagoyal22 merged 1 commit into
skillsfrom
sagoyal22/agent-evals
Nov 11, 2026
Merged

sagoyal22 merged 1 commit into
skillsfrom
sagoyal22/agent-evals

Conversation

@sagoyal22

Copy link
Copy Markdown
Collaborator

Why?

Added OP-10: Remove Principal or Tenant, a new Kerberator operational skill for safely offboarding resources using native Kubernetes commands.

The skill includes four Python scripts:

  • precheck.py — Validates resource existence, Kubernetes permissions, and dependencies before deletion.
  • inspect_dependencies.py — Identifies associated Principals, Secrets, and Tenant-managed resources.
  • remove_resource.py — Reruns safety checks, requires target-specific confirmation, and executes the approved deletion.
  • verify_removal.py — Independently verifies deletion, with bounded polling to handle Kubernetes finalizers and asynchronous cleanup.

Principal deletion uses orphan propagation, while Tenant deletion uses background cascading deletion to clean up Kubernetes-owned child resources.

How was this tested?

  • Python syntax checks passed for all four scripts.
  • Mocked checks passed for Tenant verification scenarios.
  • Manually verified against a live Kubernetes cluster (kerberator-project).
  • Completed two supervised end-to-end evaluations using GitHub Copilot CLI.

Test 1 — Disabled test Principal (op10-e2e-2005)

Created a disposable Principal, completed dependency inspection, obtained explicit deletion approval, and successfully deleted it. Independently confirmed RESULT: VERIFIED.

Test 2 — Enabled Principal (uid-2004)

Tested removal of an enabled Principal with an existing keytab Secret. Copilot inspected accessible workload references, requested approval, and successfully deleted the Principal. Independent verification returned RESULT: VERIFIED, and the three remaining Principals were confirmed healthy.

Both tests demonstrated approval handling, dependency checks, and successful deletion without automatically removing referenced Secrets.

Breaking changes

  • No breaking changes.
  • Breaking API change.

This PR adds a new operational skill without modifying the Kerberator API or CRD schemas.

Docs

  • Added SKILL.md documenting the complete OP-10 workflow, approval requirements, and safety restrictions.
  • CHANGELOG entry added.

Safety and limitations

Deletion requires explicit approval for the exact resource, namespace, and context. The scripts perform read-only prechecks before modifying resources and independently verify results.

Tenant deletion is implemented but has not yet been tested end-to-end. Testing is pending availability of a suitable test Tenant. Current RBAC restrictions also prevent full inspection of certain Tenant-owned resources, so incomplete cleanup verification is reported rather than assumed successful.

The bounded polling logic has passed syntax and mocked checks, but live testing of the pending-to-verified transition remains outstanding.

@sagoyal22
sagoyal22 merged commit 9267407 into skills Nov 11, 2026
7 of 9 checks passed
@sagoyal22
sagoyal22 deleted the sagoyal22/agent-evals branch November 11, 2026 03:32
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