WAF-AGN-030 – Reasoning Transparency
Beschreibung
Agent decisions must be traceable – not a black box. Every decision step MUST be logged including chain of thought, reasoning, and decision outcome. Audit trails MUST preserve the full context of agent decision-making for compliance and debugging.
Begründung
| Risiko | Beschreibung |
|---|---|
Risk |
Opaque agent decisions prevent root-cause analysis and regulatory audits. |
Risk |
Missing reasoning chains make it impossible to demonstrate compliance with business rules. |
Anforderungen
-
Agent decisions must be traceable – not a black box.
-
Every decision step MUST be logged including chain of thought, reasoning, and decision outcome.
-
Audit trails MUST preserve the full context of agent decision-making for compliance and debugging.
Implementierungsleitfaden
-
Document the requirement in a version-controlled policy or standard.
-
Assign ownership and establish a review cadence (e.g., quarterly).
-
Implement the required configuration as code in Terraform or equivalent IaC.
Reifegrade
| Level | Name | Kriterien |
|---|---|---|
L1 |
Ad hoc – control not consistently applied |
* Manual evidence exists for some workloads, but coverage is unknown. |
L2 |
Standardised – policy defined and communicated |
* A version-controlled policy, ADR, or standard describes the requirement. |
L3 |
Integrated – automated validation in CI/CD |
* Terraform checks run automatically on pull requests and report results. |
L4 |
Auditable – metrics and exceptions tracked |
* Control coverage, failures, and approved exceptions are reported quarterly. |
L5 |
Optimised – continuous improvement based on data |
* Control effectiveness is measured and iteratively improved. |
Checks
waf-agn-030.tf.aws.bedrock-agent-logging-enabled
Engine: terraform | Provider: aws | Automated: Ja
AWS Bedrock agent reasoning must be logged
AWS Bedrock agents must have inference logging enabled to capture chain of thought, reasoning steps, and decision outcomes. Logs must include prompt, model response, and metadata.
Scope: resource — aws_bedrockagent, aws_cloudwatch_log_group
Assertions:
* name not empty — Agent reasoning logging must be configured.
Remediation: Enable inference logging in AWS Bedrock console or via API. Configure CloudWatch log group for agent inference logs. Set log level to INCLUDE_INFERENCES for full chain of thought.
resource "aws_cloudwatch_log_group" "agent_reasoning" {
name = "/aws/bedrock/inference-logs/reasoning"
}
resource "aws_bedrockagent" "reasoning_agent" {
agent_name = "reasoning-enabled-agent"
# Logging enabled via CloudWatch configuration
}
resource "aws_bedrockagent" "no_reasoning_log" {
agent_name = "black-box-agent"
# No reasoning logging configured
# WAF-AGN-030 Violation
}
waf-agn-030.tf.azurerm.diagnostic-setting-enabled
Engine: terraform | Provider: azurerm | Automated: Ja
Azure AI services must have diagnostic settings enabled for traceability
Azure Cognitive Services / AI services accounts must have diagnostic settings enabled to capture audit logs including requests, responses, and token usage.
Scope: resource — azurerm_monitor_diagnostic_setting
Assertions:
* target_resource_id not empty — Diagnostic setting must target an AI services account.
* log_analytics_workspace_id not empty — Diagnostic setting must forward logs to a Log Analytics workspace.
* enabled_log attribute exists — Diagnostic setting must enable audit logs.
Remediation: Add azurerm_monitor_diagnostic_setting for the azurerm_cognitive_account to forward audit logs to a Log Analytics workspace.
resource "azurerm_log_analytics_workspace" "ai_logs" {
name = "ai-logs"
location = azurerm_resource_group.main.location
resource_group_name = azurerm_resource_group.main.name
sku = "PerGB2018"
retention_in_days = 90
}
resource "azurerm_monitor_diagnostic_setting" "ai_audit" {
name = "ai-audit-logs"
target_resource_id = azurerm_cognitive_account.ai.id
log_analytics_workspace_id = azurerm_log_analytics_workspace.ai_logs.id
enabled_log {
category = "Audit"
}
metric {
category = "AllMetrics"
}
}
resource "azurerm_cognitive_account" "ai" {
name = "ai-services-account"
# No diagnostic setting configured
# WAF-AGN-030 Violation: agent decisions are not traceable
}
waf-agn-030.tf.google.vertex-agent-logging-enabled
Engine: terraform | Provider: google | Automated: Ja
Google Vertex AI agent reasoning must be logged
Google Vertex AI agents must have debugging and reasoning logs enabled. Logs must capture chain of thought, tool calls, and decision paths.
Scope: resource — google_vertex_ai_agent, google_logging_project_sink
Assertions:
* name not empty — Agent reasoning logging must be configured.
Remediation: Enable Cloud Logging for Vertex AI. Configure log include patterns to capture agent reasoning. Set log level to DEBUG for full visibility.
resource "google_logging_project_sink" "vertex_reasoning" {
name = "vertex-reasoning-logs"
destination = "logging.googleapis.com/projects/${data.google_project.project.id}/logs/vertex-ai-reasoning"
filter = "resource.type=vertex_ai.custom_model OR resource.type=vertex_ai.endpoint"
}
resource "google_vertex_ai_agent" "logging_agent" {
display_name = "reasoning-logged"
}
resource "google_vertex_ai_agent" "no_logging" {
display_name = "black-box"
# No reasoning logging
# WAF-AGN-030 Violation
}
waf-agn-030.tf.aws.tracing-enabled
Engine: terraform | Provider: aws | Automated: Ja
Distributed tracing must be enabled for agents
Agent operations must be traced using AWS X-Ray or similar distributed tracing. Traces must include agent ID, operation type, latency, and decision points.
Scope: resource — aws_lambda_function, aws_bedrockagent
Assertions:
* environment.variables.AWS_XRAY_TRACING_NAME not empty — Distributed tracing must be enabled via X-Ray.
Remediation: Enable X-Ray tracing for Bedrock agent invocations. Use AWS SDK with tracing enabled (AWS_XRAY_TRACING_NAME environment variable). Instrument agent code with X-Ray SDK.
resource "aws_lambda_function" "agent_handler" {
function_name = "agent-handler"
# Tracing enabled via environment variable
environment {
variables = {
AWS_XRAY_TRACING_NAME = "agent-service"
}
}
}
resource "aws_lambda_function" "untraced" {
function_name = "untraced-agent"
# No X-Ray tracing enabled
# WAF-AGN-030 Violation
}
waf-agn-030.tf.stackit.agentic-decisions-traceable
Engine: terraform | Provider: stackit | Automated: Ja
Agent decisions must be traceable – not a black box for stackit
Agent decisions must be traceable – not a black box must be documented in IaC via a agentic-decisions-traceable tag/label on stackit_project. This validates the control is tracked as code.
Scope: resource — stackit_project
Assertions:
* labels key exists — stackit_project is missing the agentic-decisions-traceable tag/label.
Remediation: Add a agentic-decisions-traceable tag/label to the stackit_project resource to show the stackit implementation of WAF-AGN-030 is tracked in IaC.
resource "stackit_project" "example" {
labels = {
agentic-decisions-traceable = "true"
}
}
resource "stackit_project" "example" {
# Missing agentic-decisions-traceable labels
}
waf-agn-030.tf.ovh.agentic-decisions-traceable
Engine: terraform | Provider: ovh | Automated: Ja
Agent decisions must be traceable – not a black box for ovh
Agent decisions must be traceable – not a black box must be documented in IaC via a agentic-decisions-traceable tag/label on ovh_cloud_project. This validates the control is tracked as code.
Scope: resource — ovh_cloud_project
Assertions:
* tags key exists — ovh_cloud_project is missing the agentic-decisions-traceable tag/label.
Remediation: Add a agentic-decisions-traceable tag/label to the ovh_cloud_project resource to show the ovh implementation of WAF-AGN-030 is tracked in IaC.
resource "ovh_cloud_project" "example" {
tags = {
agentic-decisions-traceable = "true"
}
}
resource "ovh_cloud_project" "example" {
# Missing agentic-decisions-traceable tags
}
waf-agn-030.tf.hcloud.agentic-decisions-traceable
Engine: terraform | Provider: hcloud | Automated: Ja
Agent decisions must be traceable – not a black box for hcloud
Agent decisions must be traceable – not a black box must be documented in IaC via a agentic-decisions-traceable tag/label on hcloud_server. This validates the control is tracked as code.
Scope: resource — hcloud_server
Assertions:
* labels key exists — hcloud_server is missing the agentic-decisions-traceable tag/label.
Remediation: Add a agentic-decisions-traceable tag/label to the hcloud_server resource to show the hcloud implementation of WAF-AGN-030 is tracked in IaC.
resource "hcloud_server" "example" {
labels = {
agentic-decisions-traceable = "true"
}
}
resource "hcloud_server" "example" {
# Missing agentic-decisions-traceable labels
}
Evidenz
| Art | Erforderlich | Beschreibung |
|---|---|---|
|
Erforderlich |
Terraform configuration implementing the control. |
|
Erforderlich |
Policy, ADR, or standard documenting the requirement. |
|
Optional |
Cloud console or API output confirming runtime state. |
Verwandte Controls
-
WAF-PERF-040 == Regulatorisches Mapping
| Framework | Controls |
|---|---|
ISO 27001:2022 |
* A.8.1 – Information security roles and responsibilities * A.8.2 – Privileged access rights |
ISO 27017 |
* CLD.9.5 – Segregation in virtual computing environments |
SOC 2 Type II |
* CC4.1 – Monitoring activities * CC7.1 – Infrastructure and software monitoring |
NIST SP 800-53 |
* AU-2 – Event logging * AU-3 – Event content * AU-12 – Audit generation |
NIST CSF 2.0 |
* DE.CM – Continuous monitoring * DE.DP – Data protection |
GDPR |
* Art. 32 – Security of processing * Art. 5(1)(f) – Integrity and confidentiality |
PCI DSS v4.0 |
* Req 6.4 – Secure development lifecycle * Req 10 – Monitor and detect threats |
CSA STAR |
* CCM Logging and Monitoring |
BSI C5:2020 |
* OPS-01 – Operational monitoring * OPS-02 – Operational control |
TISAX |
* Information security – Monitoring and logging |
ANSSI SecNumCloud |
* Domain – Logging and monitoring |
BIO |
* BIO – Logboekhouding en monitoring |
ENS High |
* op.exp.6 – Gestión de cambios |
UK NCSC CAF |
* A4 – Policy and assurance |
FedRAMP |
* AU-2, AU-3, AU-12 (Moderate baseline) |
CMMC 2.0 |
* AU.L2-3.8.1 – Flow audit logs to central log management |
IT-Grundschutz |
* ORP.1 – Organisation |
IRAP |
* ISM – Logging and monitoring |
CCCS PBMM |
* AU-2, AU-3 – Logging and audit |
MAS TRM |
* Ch.9 – Change management |
ISMAP |
* Monitoring and logging controls |
FISC |
* Technical measures – Logging and monitoring |