Skip to content

fix: scheduled and relayed prompts go through the prompt gate - #47

Merged
rbartoli merged 2 commits into
nextfrom
fix/gate-scheduled-and-relayed-prompts
Oct 31, 2026
Merged

rbartoli merged 2 commits into
nextfrom
fix/gate-scheduled-and-relayed-prompts

Conversation

@rbartoli

Copy link
Copy Markdown
Owner

This is L4 from the 2026-10-24 security review.

sourceOf mapped every origin other than composer, bridge and sdk to other, and the prompt gate lets other through untouched. That left these prompts unchecked:

  • scheduled-trigger: a schedule, routine or /loop firing;
  • channel: a message an MCP server relays from Slack, Telegram and the like, which anyone who can post in that channel can send;
  • slack-ping.

So a /loop on a 520k-token session re-read the whole context on every firing, without a question, and a relayed message could do the same. Inside those turns the agent and tool gates still applied.

Changes

  • Those three origins now count as headless, so the prompt gate holds a heavy prompt with the reason, and a dormant heavy one counts against the machine-wide cap, as in claude -p. There is nobody at the keyboard to answer, so they are never asked, even in an interactive session.
  • A new fromPerson() (composer, bridge, sdk) decides who may lift limits, by bracket marker or by /agent-guard allow. Without it, the move to headless would have let a channel message reading [allow-usage-guard] lift every limit. A test pins that.
  • Background-task notifications, other sessions' messages and every other origin still pass untouched, as the README says.

Test plan

  • New tests: a scheduled, channel or Slack prompt at 520k is held with a reason and never asked; a marker from a channel or schedule is an ordinary prompt, and no override is journaled
  • claude plugin test . on 2.1.310: 105 pass. With hooks/register.ts stashed, the hold test fails. The marker test passes either way and guards against that regression.
  • claude plugin validate . --strict and tsc are clean
  • CI is green

@rbartoli
rbartoli changed the base branch from main to next October 31, 2026 21:59
…d-relayed-prompts

* origin/next:
  fix: say when the store stops saving (#46)
  fix: check records read back from the store value by value (#45)
  fix: a question shows an agent's name only when it is a plain one (#44)
  docs: say the store's records are keyed by the full session id (#43)
  chore: release 1.1.3 (#57)
  docs: checked against Claude Code 2.1.316, and its resume warning (#52)
  fix: the guard never submits a prompt, and Cancel no longer doubles it (#56)
  docs: date 1.1.2 to the day it was released (#55)
  chore: release 1.1.2 (#53)

# Conflicts:
#	TESTING.md
@rbartoli
rbartoli merged commit 6c2adf4 into next Oct 31, 2026
4 checks passed
@rbartoli
rbartoli deleted the fix/gate-scheduled-and-relayed-prompts branch October 31, 2026 22:00
rbartoli added a commit that referenced this pull request Oct 31, 2026
…near-limit

* origin/next:
  fix: scheduled and relayed prompts go through the prompt gate (#47)
  fix: say when the store stops saving (#46)
  fix: check records read back from the store value by value (#45)
  fix: a question shows an agent's name only when it is a plain one (#44)
  docs: say the store's records are keyed by the full session id (#43)
  chore: release 1.1.3 (#57)
  docs: checked against Claude Code 2.1.316, and its resume warning (#52)
  fix: the guard never submits a prompt, and Cancel no longer doubles it (#56)
  docs: date 1.1.2 to the day it was released (#55)
  chore: release 1.1.2 (#53)

# Conflicts:
#	TESTING.md
rbartoli added a commit that referenced this pull request Oct 31, 2026
* origin/next:
  feat: from 95%, wakeups and scheduled jobs are refused (#48)
  fix: scheduled and relayed prompts go through the prompt gate (#47)
  fix: say when the store stops saving (#46)
  fix: check records read back from the store value by value (#45)
  fix: a question shows an agent's name only when it is a plain one (#44)
  docs: say the store's records are keyed by the full session id (#43)
  chore: release 1.1.3 (#57)
  docs: checked against Claude Code 2.1.316, and its resume warning (#52)
  fix: the guard never submits a prompt, and Cancel no longer doubles it (#56)
  docs: date 1.1.2 to the day it was released (#55)
  chore: release 1.1.2 (#53)

# Conflicts:
#	TESTING.md
rbartoli added a commit that referenced this pull request Oct 31, 2026
…side-caps

* origin/next:
  feat: the burn rule looks at time to empty (#49)
  feat: from 95%, wakeups and scheduled jobs are refused (#48)
  fix: scheduled and relayed prompts go through the prompt gate (#47)
  fix: say when the store stops saving (#46)
  fix: check records read back from the store value by value (#45)
  fix: a question shows an agent's name only when it is a plain one (#44)
  docs: say the store's records are keyed by the full session id (#43)
  chore: release 1.1.3 (#57)
  docs: checked against Claude Code 2.1.316, and its resume warning (#52)
  fix: the guard never submits a prompt, and Cancel no longer doubles it (#56)
  docs: date 1.1.2 to the day it was released (#55)
  chore: release 1.1.2 (#53)

# Conflicts:
#	TESTING.md
rbartoli added a commit that referenced this pull request Oct 31, 2026
* origin/next:
  feat: Haiku agents stay out of the running and starts limits (#50)
  feat: the burn rule looks at time to empty (#49)
  feat: from 95%, wakeups and scheduled jobs are refused (#48)
  fix: scheduled and relayed prompts go through the prompt gate (#47)
  fix: say when the store stops saving (#46)
  fix: check records read back from the store value by value (#45)
  fix: a question shows an agent's name only when it is a plain one (#44)
  docs: say the store's records are keyed by the full session id (#43)
  chore: release 1.1.3 (#57)
  docs: checked against Claude Code 2.1.316, and its resume warning (#52)
  fix: the guard never submits a prompt, and Cancel no longer doubles it (#56)
  docs: date 1.1.2 to the day it was released (#55)
  chore: release 1.1.2 (#53)

# Conflicts:
#	TESTING.md
#	hooks/register.ts
rbartoli added a commit that referenced this pull request Oct 31, 2026
* origin/next:
  feat: /agent-guard simulate shows what a rule does (#51)
  feat: Haiku agents stay out of the running and starts limits (#50)
  feat: the burn rule looks at time to empty (#49)
  feat: from 95%, wakeups and scheduled jobs are refused (#48)
  fix: scheduled and relayed prompts go through the prompt gate (#47)
  fix: say when the store stops saving (#46)
  fix: check records read back from the store value by value (#45)
  fix: a question shows an agent's name only when it is a plain one (#44)
  docs: say the store's records are keyed by the full session id (#43)
  chore: release 1.1.3 (#57)
  docs: checked against Claude Code 2.1.316, and its resume warning (#52)
  fix: the guard never submits a prompt, and Cancel no longer doubles it (#56)
  docs: date 1.1.2 to the day it was released (#55)
  chore: release 1.1.2 (#53)

# Conflicts:
#	TESTING.md
#	core/index.ts
#	hooks/register.ts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant