Skip to content

feat: ArbitusPolicy CRD — Kubernetes-native per-agent policy management #105

Description

@nfvelten

Migrated from nfvelten/arbitus#133

Summary

Per-agent policies as first-class Kubernetes objects, managed via kubectl and compatible with GitOps workflows (Flux, ArgoCD).

apiVersion: arbitus.dev/v1alpha1
kind: ArbitusPolicy
metadata:
  name: cursor-policy
  namespace: ai-agents
spec:
  agent: cursor
  allowedTools: [read_file, "list_*"]
  deniedTools: [delete_file]
  rateLimit: 30
  rules:
    blockPatterns: ["password", "api_key"]
    filterMode: block
    blockPromptInjection: true

Benefits over ConfigMap approach

  • Per-policy RBAC (K8s admins control who can create/edit agent policies)
  • Status subresource (controller reports active tools, last-applied, validation errors)
  • Works naturally with GitOps and policy-as-code workflows

Implementation via kube-rs

#[derive(CustomResource, Serialize, Deserialize, Clone, JsonSchema)]
#[kube(group = "arbitus.dev", version = "v1alpha1", kind = "ArbitusPolicy", namespaced)]
pub struct ArbitusSpec {
    pub agent: String,
    pub allowed_tools: Option<Vec<String>>,
    pub rate_limit: Option<u32>,
    pub rules: Option<PolicyRules>,
}

Prerequisites

  • #132 (ConfigMap watcher) — establishes the kube-rs dependency and live-config infrastructure

References

  • FEATURE_ADOPTION_FEASIBILITY.md §3 (Tier 3)

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestp3Low priority

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions