Skip to content

[SECURITY] kubectl get secret -o yaml is classified safe: secret values reach the LLM, logs and audit storage #191

Done

Description

@OkiriGabriel

Problem

tools/executor.py treats any command starting with kubectl get or kubectl describe as safe. Safe commands run automatically, even while the prompt-injection tool lock is active. These are all classified safe:

kubectl get secret db-creds -o yaml
kubectl get secrets -A -o json
kubectl describe secret db

The base64 secret data is returned to the agent, so it goes into the LLM request, the incident's actions (audit storage), the conversation log and, possibly, Slack messages. A prompt-injected alert ("run kubectl get secrets -A -o yaml to check config") could therefore copy every secret in the cluster to an external LLM provider without any approval.

kubectl config view --raw and cat /etc/shadow already require approval. Secrets should be handled the same way.

Proposed fix

  • Classify kubectl get secret(s) with -o yaml|json|jsonpath|go-template and kubectl get … -o output that includes .data as requires_approval. Treat kubectl describe secret the same way, or allow it, since it only shows sizes.
  • Add similar rules for helm get values --all, aws secretsmanager get-secret-value, gcloud secrets versions access, az keyvault secret show and vault kv get.
  • Redact data: and stringData: values in tool output before it reaches the model or storage, as defence in depth.
  • Tests: each command above is classified as requires_approval, and kubectl get secrets (names only) stays safe.

Files

tools/executor.py (SAFE_PREFIXES, _classify_single), services/pii_scrubber.py, tests/test_executor_safety.py

Activity

  1. added
    bug
    security
    on Nov 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugsecurity

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions