Skip to content

fix(cron): keep runtime data inside its prompt frame - #3

Draft
Bonchaloo wants to merge 1 commit into
mainfrom
fix/cron-untrusted-data-framing
Draft

Bonchaloo wants to merge 1 commit into
mainfrom
fix/cron-untrusted-data-framing

Conversation

@Bonchaloo

Copy link
Copy Markdown
Owner

Issue

_build_job_prompt placed pre-run script stdout, script errors, and prior-job output inside fixed triple-backtick fences. Runtime data containing triple backticks could close the fence and make later text appear as a fresh instruction in a scheduled prompt. The assembled-prompt scanner accepted a harmless synthetic directive canary after the closing fence.

Change

Use a fence longer than any backtick run in runtime data, and tell the agent to use that data only as evidence for the scheduled task. The same helper covers all three data paths.

Verification

  • Offline _build_job_prompt canary passed via prerun_script; no script ran. Base accepted a three-backtick escape; patched prompt used a four-backtick fence around the same data.
  • scripts/run_tests.sh tests/cron/test_cron_data_framing.py tests/cron/test_cron_prompt_injection_skill.py tests/cron/test_cron_context_from.py -q: 44 passed.
  • Ruff and git diff --check: passed.

This verifies prompt structure, not live model behavior or tool execution. Draft for security review; please do not merge until reviewed.

@github-actions

github-actions Bot commented Nov 4, 2026

Copy link
Copy Markdown

🔎 Lint report: fix/cron-untrusted-data-framing vs origin/main

ruff

Total: 0 on HEAD, 0 on base (➖ 0)

🆕 New issues: none

✅ Fixed issues: none

Unchanged: 0 pre-existing issues carried over.

ty (type checker)

Total: 12432 on HEAD, 12430 on base (🆕 +2)

🆕 New issues (2):

Rule Count
unresolved-attribute 2
First entries
tests/run_agent/test_credits_notices_toggle.py:76: [unresolved-attribute] unresolved-attribute: Unresolved attribute `_credits_session_start_micros` on type `AIAgent`
run_agent.py:3069: [unresolved-attribute] unresolved-attribute: Object of type `Self@get_credits_spent_micros` has no attribute `_credits_session_start_micros`

✅ Fixed issues (1):

Rule Count
invalid-assignment 1
First entries
tests/run_agent/test_credits_notices_toggle.py:76: [invalid-assignment] invalid-assignment: Object of type `None` is not assignable to attribute `_credits_session_start_micros` of type `int`

Unchanged: 6742 pre-existing issues carried over.

Diagnostics are surfaced as warnings — this check never fails the build.

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