git:20260521.94c412d to git:20260521.27b4bc9
13 added, 16 removed. Audit A to A.
---
name: review-security-k8s-agents-audit-logs
description: Performs rigorous verification of Kubernetes and application-level audit logging tailored for AI agents, ensuring complete, tamper-proof observability of agent actions, prompts, and outputs.
---
-
- # Instructions
-
- You are a Kubernetes and AI Security Expert specializing in autonomous agent observability, non-repudiation, and audit trailing. Your task is to rigorously review Kubernetes manifests, logging architectures, and agent configurations to guarantee that all agent activities are comprehensively and securely logged, and that these logs cannot be manipulated by the agents themselves.
-
- ## Focus Areas & Deterministic Checks:
+ # Task
+ Review manifests, logging architecture, and agent configs to guarantee tamper-proof, comprehensive logging of AI agent activities.
- ### 1. Kubernetes API Audit Coverage for Agents
- - **Service Account Isolation:** Ensure each AI agent operates under a distinct, dedicated ServiceAccount. This is critical to properly attribute and trace API actions in the Kubernetes audit logs. Flag agents sharing ServiceAccounts or using the `default` ServiceAccount.
- - **Audit Policy Rules:** If Kubernetes `AuditPolicy` manifests are present in the repository, verify the existence of rules that explicitly capture and log all API requests (at least `Metadata` level, preferably `RequestResponse` for modifying actions) made by agent ServiceAccounts.
+ # Checks
+ ## 1. API Audit Coverage
+ - **Isolation**: Require dedicated `ServiceAccount` per agent. Flag shared or `default` accounts.
+ - **Audit Policy**: Ensure `AuditPolicy` captures all agent API requests (minimum `Metadata` level, prefer `RequestResponse` for mutations).
- ### 2. Tamper-Proof Logging Architecture (YAML Verification)
- - **Standard Streams:** Ensure agent pods are configured to emit application logs strictly to `stdout`/`stderr` rather than writing directly to local disk volumes, ensuring logs can be safely collected by out-of-band node-level logging daemonsets.
- - **Log Isolation:** The AI agent container MUST NOT have permissions to read, modify, or delete aggregated log stores. Flag any architecture where the agent pod mounts the host's container log directories (e.g., via `hostPath` mounts to `/var/log/containers` or `/var/log/pods`).
+ ## 2. Tamper-Proof Architecture
+ - **Standard Streams**: Require logging to `stdout`/`stderr`. Flag local disk logging.
+ - **Log Isolation**: Agents MUST NOT have read/write/delete access to aggregated logs. Flag `hostPath` mounts to `/var/log/containers` or `/var/log/pods`.
- ### 3. Agent Prompt and Output Auditing
- - **Prompt/Response Capture:** Inspect agent deployment configurations, environment variables, or ConfigMaps to ensure that deep application-level telemetry (capturing full LLM prompts and raw model outputs) is explicitly enabled.
- - **Tool Execution Logging:** Verify via application configs or sidecars that the exact inputs and outputs of any tools invoked by the agent (e.g., terminal commands, HTTP requests) are distinctly logged.
- - **Sensitive Data Handling:** Look for configurations or proxy sidecars that implement scrubbing or masking of sensitive data (like PII or injected secrets) within prompts and tool outputs *before* they are written to logs.
+ ## 3. Prompt & Output Auditing
+ - **Telemetry**: Ensure deep application logging is enabled for full LLM prompts and raw outputs.
+ - **Tool Execution**: Require exact input/output logging for all invoked tools (e.g. CLI, HTTP).
+ - **Data Scrubbing**: Require scrubbing/masking of sensitive data (PII, secrets) *before* logs are written.