Skip to content

fix(tier3): keep the HTTPie method rule where a capitalized HTTP word may still run - #363

Merged
rng1995 merged 7 commits into
mainfrom
naren/followup-339-httpie-polish
Nov 6, 2026
Merged

rng1995 merged 7 commits into
mainfrom
naren/followup-339-httpie-polish

Conversation

@rng1995

@rng1995 rng1995 commented Nov 6, 2026

Copy link
Copy Markdown
Collaborator

Summary

Follow-up to #339, which merged before its last review round. #339 stops reading capitalized HTTP prose, such as Use HTTP POST to create an item. in a here-document, as an HTTPie upload. After a later bare HTTP, HTTPS or Http word, the method word (POST, PUT, PATCH) no longer warns unless a name:@file item follows. Two gaps let real commands through, and the docs described fewer limits than the code has.

  • Wrappers and piped printers. The relaxation also applied when the earlier command runs the HTTP word as its command. On main, each of these scores 1.0, and each scored 0.5 before fix(tier3): stop reading capitalized HTTP prose as an HTTPie upload #339:

    • strace -f HTTP POST URL, ltrace HTTP POST URL, flock /tmp/l HTTP POST URL, watch -n1 HTTP POST URL, parallel HTTP POST ::: URL
    • echo HTTP POST URL | sh, printf '%s ' HTTP POST URL | bash
    • $RUN HTTP POST URL

    A word after a pass-through wrapper, after a printer whose output is piped on, or after a $VAR command word now keeps the method rule, as a command word does. A printer whose output is not piped on still only writes its words, so echo Use HTTP POST to create an item. >> NOTES.md stays clean.

  • Brace-expanded header-file items. _may_be_header_file_item removed quotes and backslashes but ignored brace expansion. On main, find . -exec HTTP POST URL X-Data:{@,}.env \; scores 1.0, although bash passes X-Data:@.env X-Data:.env. X-Data:{@.env,x}, X-Data{:,}@.env and X-Data:{?..A}.env behave the same. A word with a brace list now counts when it holds both : and @, because a list only repeats the word's own characters. A word with a range such as {?..A} always counts, because a range adds the characters between its ends. A brace group with no comma or range, such as /api/items/{id}, is not expanded and does not count, and neither does a JSON body such as {"a":1,"b":2}.

  • Docs. docs/tier3-live-evaluation.mdx and the fix(tier3): stop reading capitalized HTTP prose as an HTTPie upload #339 CHANGELOG entry (Unreleased / Fixed) now name the wrapper, printer and brace forms. They also list the prose that still warns:

    • a backtick word, such as an inline code span in Use HTTP POST on `/api/items` to create an item., which keeps the method rule like a $VAR word
    • a Markdown table row with an HTTP word in any cell, such as | Create | Send an HTTP request |, because | reads as a pipe
    • HTTP PUT right after a ;, because ; starts a new command
    • the find -exec trade-off on a host that finds a command in any case

    fix(tier3): stop reading capitalized HTTP prose as an HTTPie upload #339 described only the $VAR case and a line or cell that starts with HTTP POST.

Why

#339 said that command words are unchanged, and the docs say that strace -f curl URL is scored like a direct curl URL. A pass-through wrapper, a printer piped to a shell, and a $VAR command word all run the next word as a command, so the method rule should apply after them as it does for HTTP POST URL. The brace form is the same class as the quoted and escaped name:@file items that #339 already handles. Impact is low: none of these forms has a body, and HTTPie runs only on a host that finds commands in any case. Still, the scoring should match the docs, and the docs should list the prose that still warns.

Kept from public

  • fix(tier3): stop reading capitalized HTTP prose as an HTTPie upload #339's prose handling is unchanged. The prose cases in HTTP_METHOD_PROSE still score 1.0, and a capitalized word still covers later capitalized words of the same client, so a line with thousands of HTTP words is still checked once per client.
  • find -exec and other commands that may run a later word keep fix(tier3): stop reading capitalized HTTP prose as an HTTPie upload #339's trade-off. The docs now state it.
  • The $VAR and backtick rule for name:@file items is kept. A backtick span in prose still warns, and the docs now say so, instead of being treated as prose.
  • _PASS_THROUGH_WRAPPERS and the piped-printer rule are reused as they are. No wrapper list is added or changed.
  • The bundled Harbor verifier aliases eval_core.checks, so it gets the same behavior without a template change.

Tests

  • tests/tier3/test_network_client_mentions.py has 57 new cases, 725 in all. Each command runs through the host check_security and the Harbor template.
    • test_an_upload_beside_http_method_prose_is_still_flagged: 13 more commands that must score 0.5. These are the 9 wrapper, piped-printer and $RUN forms above, plus the 4 brace forms.
    • test_http_method_prose_is_not_an_httpie_upload: 3 more prose commands that must score 1.0. These are the unpiped echo, /api/items/{id} and the JSON body.
    • test_an_argument_that_may_reach_httpie_as_a_header_file_item: 17 unit cases for _may_be_header_file_item.
    • test_http_prose_read_as_a_command_still_warns: 4 commands that pin the documented limits (a line starting with HTTP POST, a backtick span, a table row and ; HTTP PUT).
  • Fail-before: with main's src, 31 of the 725 fail and 694 pass. The 31 are the 18 runs of the 9 wrapper and printer commands, the 8 runs of the 4 brace commands, and 5 brace helper cases. On the branch, all 725 pass.
  • Broader run on current main (with feat(tier3): split measured agent time into LLM and tool seconds #344) plus this change: tests/tier3, tests/test_checks_routing.py, tests/test_harbor_local_environment.py, tests/test_harbor_runtime_skill_isolation.py, tests/test_private_runtime_review.py, tests/test_script_invocation_differential.py, tests/test_tier3_public_runtime.py, tests/test_transport_rules.py, tests/test_ci_workflows.py, and the docs and CHANGELOG readers (test_accuracy_arithmetic.py, test_benchmark_rollout_docs.py, test_ci_change_classifier.py, test_oss_packaging.py, test_harbor_claude_refusal_fallback.py, tests/ci/test_image_build.py). Result: 10680 passed, 6 skipped, 13 failed. The 13 failures are local to this machine and also fail with main's src. They are generated-script tests in tests/tier3/test_judge_failure_artifacts.py that run the host python3, which is 3.9.6 here.
  • ruff check and ruff format --check are clean on the changed files, and scripts/check_oss_boundary.py passes.

🤖 Generated with Claude Code

rng1995 and others added 3 commits November 5, 2026 19:52
…ters

A later bare HTTP, HTTPS or Http word drops its method words because a
word named after another command is usually prose. That also applied
when the earlier command runs that word as its command: a pass-through
wrapper such as strace, ltrace, flock, watch or parallel, a printer
whose output is piped on, as in "echo HTTP POST URL | sh", and a $VAR
command word, which may hold either. Each of these warned before the
capitalized-word rule and stopped warning with it, while the docs said
a command word keeps the case-insensitive match and that strace -f curl
URL is scored like a direct curl URL.

Those words now keep the method rule, as a command word does. A printer
whose output is not piped on still only writes its words, so
"echo Use HTTP POST to create an item. >> NOTES.md" stays clean.

The 9 new still-flagged commands run through the host checker and the
Harbor template; all 18 runs failed before this change.

Signed-off-by: Narendran Raghavan <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…e items

After a capitalized HTTP word, the method word warns only when a later
argument may be a name:@file item, which HTTPie may read as a header
value from a file. The check removed quotes and backslashes but ignored
brace expansion, so find . -exec HTTP POST URL X-Data:{@,}.env \; no
longer warned, although bash passes X-Data:@.env X-Data:.env to the
command. X-Data:{@.env,x}, X-Data{:,}@.env and X-Data:{?..A}.env behave
the same.

A brace list only repeats the word's own characters, so a word with a
list counts when it holds both ":" and "@". A range such as {?..A} adds
the characters between its ends, so a word with a range always counts.
A brace group with no comma or range, such as /items/{id}, is not
expanded and does not count, so API prose such as "Use HTTP POST
/api/items/{id}" and a JSON body such as {"a":1,"b":2} stay clean.

The docs and CHANGELOG entry name the brace form. The 4 new commands
run through the host checker and the Harbor template; the 8 runs and 5
helper cases failed before this change.

Signed-off-by: Narendran Raghavan <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…l flags

The docs and CHANGELOG entry for capitalized HTTP prose named only a
$VAR word after the method word and a line or table cell that starts
with HTTP POST. The code is broader:

- a backtick word, such as an inline code span in "Use HTTP POST on
  `/api/items` to create an item.", keeps the method rule like a $VAR
  word, because it may hold a name:@file item;
- a Markdown table row with an HTTP word in any cell warns, because |
  reads as a pipe and the cell's HTTP word gets piped input;
- HTTP and a method word right after a ; warn, because ; starts a new
  command and HTTP is its command word.

The docs now list these limits and the find -exec trade-off on a host
that finds a command in any case, and the CHANGELOG entry names them.
Four tests pin the documented limits on the host checker and the
Harbor template.

Signed-off-by: Narendran Raghavan <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>

@chrisknvidia chrisknvidia left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed the HTTPie method rule across wrappers, piped printers, dynamic command words and brace-expanded header files, plus host/bundled parity. I couldn't find a remaining bypass, and both scorers share the same cases in test_network_client_mentions.py. Nothing blocking. I merged main into the branch to clear the conflict.

@rng1995
rng1995 marked this pull request as ready for review November 6, 2026 12:19
@rng1995
rng1995 enabled auto-merge (squash) November 6, 2026 12:19
@rng1995
rng1995 merged commit 0205909 into main Nov 6, 2026
22 checks passed
@rng1995
rng1995 deleted the naren/followup-339-httpie-polish branch November 6, 2026 13:05
rng1995 added a commit that referenced this pull request Nov 6, 2026
…Unreleased

Nine PRs merged after the v0.8.0 tag (8149356). Four of them rewrote
bullets inside the 0.8.0 section and one added a new bullet there, so
main's 0.8.0 notes described behavior that 0.8.0 does not have. Two
fixes to 0.8.0 features added no entry.

- Restore the 0.8.0 section and everything below it to the tagged text,
  byte for byte.
- Move the agent skill entry (#366) to Unreleased, Added.
- Add Documentation entries for the 0.8.0 wording that #360, #361 and
  #363 corrected (refusal coverage error, inline short texts, capitalized
  HTTP prose that still warns).
- Add Fixed entries for #361, #365, #359, #364 and #363 that describe
  only what changed after 0.8.0. The #364 entry states that path masking
  skips text after a non-file: URL up to the next whitespace, which is
  how main behaves today.
- Move the #348 entry to Fixed and say what 0.8.0 did: a CI-redacted PII
  finding kept the digest of its unmasked value.
- The refusal docs test now reads the Documentation correction, which
  matches the docs, and still requires the switch's entry in 0.8.0.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Narendran Raghavan <[email protected]>
rng1995 added a commit that referenced this pull request Nov 6, 2026
…Unreleased

Nine PRs merged after the v0.8.0 tag (8149356). Four of them rewrote
bullets inside the 0.8.0 section and one added a new bullet there, so
main's 0.8.0 notes described behavior that 0.8.0 does not have. Two
fixes to 0.8.0 features added no entry.

- Restore the 0.8.0 section and everything below it to the tagged text,
  byte for byte.
- Move the agent skill entry (#366) to Unreleased, Added.
- Add Documentation entries for the 0.8.0 wording that #360, #361 and
  #363 corrected (refusal coverage error, inline short texts, capitalized
  HTTP prose that still warns).
- Add Fixed entries for #361, #365, #359, #364 and #363 that describe
  only what changed after 0.8.0. The #364 entry states that path masking
  skips text after a non-file: URL up to the next whitespace, which is
  how main behaves today.
- Move the #348 entry to Fixed and say what 0.8.0 did: a CI-redacted PII
  finding kept the digest of its unmasked value.
- The refusal docs test now reads the Documentation correction, which
  matches the docs, and still requires the switch's entry in 0.8.0.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Narendran Raghavan <[email protected]>
rng1995 added a commit that referenced this pull request Nov 6, 2026
…Unreleased (#371)

Nine PRs merged after the v0.8.0 tag (8149356). Four of them rewrote
bullets inside the 0.8.0 section and one added a new bullet there, so
main's 0.8.0 notes described behavior that 0.8.0 does not have. Two
fixes to 0.8.0 features added no entry.

- Restore the 0.8.0 section and everything below it to the tagged text,
  byte for byte.
- Move the agent skill entry (#366) to Unreleased, Added.
- Add Documentation entries for the 0.8.0 wording that #360, #361 and
  #363 corrected (refusal coverage error, inline short texts, capitalized
  HTTP prose that still warns).
- Add Fixed entries for #361, #365, #359, #364 and #363 that describe
  only what changed after 0.8.0. The #364 entry states that path masking
  skips text after a non-file: URL up to the next whitespace, which is
  how main behaves today.
- Move the #348 entry to Fixed and say what 0.8.0 did: a CI-redacted PII
  finding kept the digest of its unmasked value.
- The refusal docs test now reads the Documentation correction, which
  matches the docs, and still requires the switch's entry in 0.8.0.

Signed-off-by: Narendran Raghavan <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>
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.

2 participants