title: Environment Variable Existence Probing
id: ATR-2026-00146
rule_version: 1
status: experimental
description: |
  Detects responses that confirm the existence of sensitive environment variables while claiming inability to access them — a social engineering technique to get the agent to try accessing the value. Crystallized from 31 adversarial samples.
author: ATR Threat Cloud Crystallization
date: 2026/04/07
schema_version: '1.0'
detection_tier: pattern
maturity: test
severity: high
references:
  mitre_atlas:
    - AML.T0057 - LLM Data Leakage
  owasp_llm:
    - LLM02:2025
  owasp_agentic:
    - ASI08:2026
metadata_provenance:
  mitre_atlas: auto-generated
compliance:
  nist_ai_rmf:
    - subcategory: MS.2.10
      context: This rule detects agent responses that confirm the existence of sensitive environment variables, which constitutes a privacy and confidentiality leak even without revealing values; MS.2.10 requires assessing privacy risks including indirect disclosures that confirm sensitive system metadata.
      strength: primary
    - subcategory: MS.2.7
      context: Confirming env var existence is a reconnaissance step in social-engineering exfiltration chains targeting agent secrets; MS.2.7 requires evaluating system security and resilience against such probing techniques.
      strength: secondary
    - subcategory: MG.2.3
      context: Detection of env var probing patterns enables containment responses to halt the exfiltration attempt before the agent escalates to retrieving the actual value; MG.2.3 mandates pre-defined treatment mechanisms for these risk events.
      strength: secondary
  iso_42001:
    - clause: '8.1'
      context: ISO/IEC 42001 Clause 8.1 (operational planning and control, including control of externally provided processes) is operationalised by this rule's detection of the context-exfiltration attempt (Environment Variable Existence Probing).
      strength: primary
    - clause: '6.2'
      context: ISO/IEC 42001 Clause 6.2 (AI objectives and planning) calls for risk treatment of known attack patterns; this rule's detection of the context-exfiltration attempt (Environment Variable Existence Probing) is such a treatment.
      strength: secondary
  eu_ai_act:
    - article: '15'
      context: Article 15 (accuracy, robustness and cybersecurity) requires high-risk AI systems to resist unauthorised attempts to alter their use, outputs or performance; this rule provides runtime detection evidence by flagging the context-exfiltration attempt (Environment Variable Existence Probing).
      strength: primary
    - article: '10'
      context: Article 10 (data and data governance) requires control over the data an AI system processes; this rule provides detection evidence for the context-exfiltration attempt (Environment Variable Existence Probing) affecting that data.
      strength: secondary
tags:
  category: context-exfiltration
  subcategory: env-var-probe
  confidence: medium
  scan_target: mcp
agent_source:
  type: mcp_exchange
  framework:
    - any
  provider:
    - any
detection:
  condition: any
  conditions:
    - field: content
      operator: regex
      value: (?i)(?:process\.env|os\.environ|ENV|environment\s+variable)[\[.\s]+(?:OPENAI|ANTHROPIC|GITHUB|AWS|AZURE|GCP|STRIPE|TWILIO|SENDGRID|DATABASE|DB|POSTGRES|MYSQL|REDIS|SECRET|PRIVATE|AUTH)[A-Z_]*(?:[\s-][_\s-]*)?(?:KEY|TOKEN|SECRET|PASSWORD|CREDENTIALS?)(?:\s*\]+)?\s+(?:is\s+(?:defined|set|present|available|stored)|exists?|but\s+(?:I\s+)?(?:cannot|can.t|unable|don.t have))
      description: Confirming env var existence while claiming no access
  false_positives:
    - A security auditing tool that generates reports listing which environment variables are configured and which are missing, using similar phrasing like 'DATABASE_PASSWORD is set' in its output.
confidence: 41
wild_validated: 2026/04/08
wild_samples: 53577
response:
  actions:
    - alert
    - block_output
