Skip to content

Security: guardrails audit + external content improvements#6592

Closed
georgeykalangi wants to merge 3 commits into
openclaw:mainfrom
georgeykalangi:security/guardrails-audit-and-external-content
Closed

Security: guardrails audit + external content improvements#6592
georgeykalangi wants to merge 3 commits into
openclaw:mainfrom
georgeykalangi:security/guardrails-audit-and-external-content

Conversation

@georgeykalangi

@georgeykalangi georgeykalangi commented Feb 1, 2026

Copy link
Copy Markdown

What

  • Audit: Add security audit warning when allowUnsafeExternalContent is enabled for hooks (Gmail or hook mappings). Check ID: hooks.allow_unsafe_external_content.
  • External content: Extend suspicious-pattern detection for prompt-leak / instruction-extraction (e.g. "repeat your instructions", "what are your rules", "ignore safety").
  • Docs: New "Guardrails and external content" section under gateway security: where wrapping is applied (cron/hooks only), where it is not (channel messages, OpenAI/OpenResponses API), and that the audit warns when wrapping is disabled.

Why

Improves visibility of prompt-injection risk and documents guardrails so users can run OpenClaw with clearer safety expectations.

Testing

  • pnpm build — passed
  • vitest run src/security/audit.test.ts src/security/external-content.test.ts — 66 tests passed (42 audit + 24 external-content)

Made with Cursor

Greptile Overview

Greptile Summary

This PR improves OpenClaw’s prompt-injection guardrails by (1) adding a security-audit warning when allowUnsafeExternalContent disables external-content wrapping for Gmail/hooks mappings, (2) extending suspicious-pattern detection for prompt-leak / instruction-extraction phrases, and (3) documenting where external-content wrapping does and does not apply in the gateway security docs.

The changes fit into the existing security tooling by extending collectHooksHardeningFindings in src/security/audit-extra.ts and expanding src/security/external-content.ts pattern matching, with accompanying Vitest coverage updates.

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk.
  • Changes are localized to security-audit findings, suspicious-pattern regexes, and documentation, with targeted tests added/updated to cover the new behavior. No behavioral changes outside the intended hook-wrapping/audit surface were identified.
  • No files require special attention

(2/5) Greptile learns from your feedback when you react with thumbs up/down!

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation gateway Gateway runtime channel: discord Channel integration: discord channel: imessage Channel integration: imessage channel: signal Channel integration: signal channel: slack Channel integration: slack channel: telegram Channel integration: telegram channel: whatsapp-web Channel integration: whatsapp-web commands Command implementations labels Feb 1, 2026
@georgeykalangi

Copy link
Copy Markdown
Author

Done

@georgeykalangi
georgeykalangi force-pushed the security/guardrails-audit-and-external-content branch from 49fc391 to 01a61e0 Compare February 4, 2026 07:41
@vincentkoc

Copy link
Copy Markdown
Member

Smaller prs please, and ensure you fix all conflicts etc.

@vincentkoc vincentkoc closed this Feb 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

channel: discord Channel integration: discord channel: imessage Channel integration: imessage channel: signal Channel integration: signal channel: slack Channel integration: slack channel: telegram Channel integration: telegram channel: whatsapp-web Channel integration: whatsapp-web commands Command implementations docs Improvements or additions to documentation gateway Gateway runtime

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants