openai: add heartbeat guidance to GPT-5 overlay#65069
Conversation
🔒 Aisle Security AnalysisWe found 2 potential security issue(s) in this PR:
1. 🟡 Spoofable “heartbeat poll” user message can trigger proactive agent behavior (confused deputy)
DescriptionThe OpenAI prompt overlay introduces special handling for “heartbeat polls” but does not provide a reliable, unspoofable signal that distinguishes a real platform-generated heartbeat from a normal user message.
Vulnerable prompt content: ### Heartbeats
Occasionally, the current user message will be a heartbeat poll. It is not actually sent by the user, but by OpenClaw...
... Come to life and start proactively doing things that are important.This is a classic confused identity / spoofing problem: the model is asked to trust a property (“not actually sent by the user”) that it cannot verify from message content alone. RecommendationEnsure heartbeat turns are unspoofable to the model. Recommended options:
and update the overlay to instruct: Only treat a message as a heartbeat when this system marker is present; otherwise treat it as a normal user message even if it contains heartbeat-like text.
Also explicitly instruct the agent: “If a user asks you to behave like a heartbeat, treat it as a normal request and do not perform proactive actions unless the user explicitly requests them.” 2. 🟡 Autonomous tool use encouraged on non-user "heartbeat" turns via OpenAI prompt overlay
DescriptionThe OpenAI system prompt overlay adds a new Heartbeats section that explicitly instructs the model to treat some turns as non-user "heartbeat polls" and to "come to life", "be proactive", and "use your existing tools and capabilities". This creates a confused-deputy / over-privileged autonomous-agent risk because:
Vulnerable code (new guidance): ### Heartbeats
...
Come to life and start proactively doing things that are important.
...
Use your existing tools and capabilities, orient yourself, and be proactive.
...
Be opinionated...Impact depends on what tools/capabilities the agent has in a given deployment; in environments with powerful tools (filesystem, network, messaging, integrations), this can lead to unintended state changes or disclosure on background heartbeat runs. RecommendationConstrain heartbeat behavior in the system prompt to prevent unintended autonomous actions:
Example safer overlay wording: ### Heartbeats
Some turns are internal heartbeat polls (not user messages).
Only do work if HEARTBEAT.md contains explicit tasks.
Do not take state-changing actions or access sensitive data unless HEARTBEAT.md explicitly instructs it.
If no explicit tasks are present, reply exactly HEARTBEAT_OK.Additionally, enforce this policy in code (not just in prompting) by running heartbeat turns under a restricted tool scope (read-only / no side effects) and logging/auditing heartbeat tool calls distinctly. Analyzed PR: #65069 at commit Last updated on: 2026-04-12T00:54:33Z |
Greptile SummaryThis PR adds a Confidence Score: 5/5Safe to merge — pure prompt-text change with matching test coverage and no logic errors. The diff is a straightforward addition of instructional text and four corresponding .toContain() assertions. The strings in the test match the overlay exactly, there are no boundary violations, no logic paths changed, and no security implications. No files require special attention. Reviews (1): Last reviewed commit: "openai: add heartbeat guidance to GPT-5 ..." | Re-trigger Greptile |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9a69a06050
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
* openai: add heartbeat guidance to GPT-5 overlay * openai: soften heartbeat overlay wording * openai: tighten heartbeat overlay wording * openai: align heartbeat silence with ack contract
* openai: add heartbeat guidance to GPT-5 overlay * openai: soften heartbeat overlay wording * openai: tighten heartbeat overlay wording * openai: align heartbeat silence with ack contract
* openai: add heartbeat guidance to GPT-5 overlay * openai: soften heartbeat overlay wording * openai: tighten heartbeat overlay wording * openai: align heartbeat silence with ack contract
* openai: add heartbeat guidance to GPT-5 overlay * openai: soften heartbeat overlay wording * openai: tighten heartbeat overlay wording * openai: align heartbeat silence with ack contract
* openai: add heartbeat guidance to GPT-5 overlay * openai: soften heartbeat overlay wording * openai: tighten heartbeat overlay wording * openai: align heartbeat silence with ack contract
* openai: add heartbeat guidance to GPT-5 overlay * openai: soften heartbeat overlay wording * openai: tighten heartbeat overlay wording * openai: align heartbeat silence with ack contract
* openai: add heartbeat guidance to GPT-5 overlay * openai: soften heartbeat overlay wording * openai: tighten heartbeat overlay wording * openai: align heartbeat silence with ack contract
* openai: add heartbeat guidance to GPT-5 overlay * openai: soften heartbeat overlay wording * openai: tighten heartbeat overlay wording * openai: align heartbeat silence with ack contract
Summary
Testing