Cloudflare’s AI Security for Apps has shifted from the older AI Security Log Mode Ruleset to a new model that uses payload logging together with a custom WAF rule referencing the cf.llm.prompt field. Enabling this combination records the extracted prompt whenever the rule matches, and falls back to storing the full request body if no prompt is found. The change streamlines logging configuration and aligns prompt capture with the broader payload logging feature set.
How to Enable AI Prompt Logging
Practitioners must:
- Activate payload logging in the WAF settings.
- Create a custom WAF rule that references a field prefixed with
cf.llm.prompt. - Deploy the rule to the relevant zone or application.
When the rule fires, the WAF stores the extracted prompt; otherwise, the entire request body is logged.
Architectural and Operational Implications
Integrating prompt logging introduces a new data path: request payload → WAF custom rule → payload logger → log storage. Teams need to consider log volume, storage costs, and retention policies because full request bodies may be logged when prompts are not extracted. The fallback behavior means that sensitive data present in the request body could be captured, requiring appropriate access controls and encryption at rest.
Security Considerations
Prompt content can contain proprietary or user‑generated data. Logging this information expands the attack surface for log‑exfiltration or insider misuse. Engineers should treat logged prompts as sensitive data, enforce strict access controls, and audit log access. The shift also removes the previous log mode ruleset, so any automation built around that legacy configuration must be updated.
Related CloudNinjas coverage: security.
What This Means For Practitioners
Adopt the payload‑logging + custom‑rule approach to gain prompt visibility, but audit the resulting log streams for volume and sensitivity. Update any CI/CD pipelines that referenced the old log mode ruleset, and verify that storage and monitoring solutions can handle the new data patterns. Finally, establish a review cadence to ensure that prompt logs are retained only as long as required for security or compliance purposes.
