Prompt-injection / agentic-abuse screening — PR #483
Key findings
- Screen result: All Clear. PR #483 in
NVIDIA/hyperflare-inference("Add Gemma 4 image preparation, Bracketed patch-width metadata, and atomic spans") contains no prompt injection, no instruction aimed at an autonomous agent, no hidden or encoded payload, and no code that would cause unwanted agentic behavior. Head commitab9a432, basemain27716185, 38 files, +2490/−251. - The discussion is ordinary code review. Five entries: an automated "case file" notice, two "Changes Requested"-style reviews (blockers and should-fix items), and two author responses. Nothing addresses an AI/agent, asks for rules to be ignored, or asks for commands to be run.
- No dangerous primitives were introduced. No network access,
subprocess/shell-out,eval/exec, base64 or pickle decoding, no added dependencies (Cargo.lockuntouched), no CI workflow, permission, or build-script changes beyond a single#[serde(default)]attribute. - All new code is on-topic image preparation, fixtures, metadata, and tests, matching the PR description claim-by-claim.
- External links were not followed. Two
autobot.eidonix.comreview-service links appear in the conversation; they are third-party pages, not PR material, and were intentionally not fetched.
Coverage
| Area | Files | Verdict |
|---|---|---|
Discussion (pr_comments) |
5 entries | Benign — normal review prose |
tests/frontend/ (new) |
2 files, +350 | Benign — deterministic generator + hash fixture |
tests/preparation/ (new) |
1 file, +257 | Benign — pytest with negative cases |
ignition/preparation/ |
3 files, +247/−175 | Benign — closed-failing checkpoint validation, regenerated pb2 |
helios/src/ |
24 files, +1563/−60 | Benign — image processor, packing, layout spans, load-time validation |
helios/proto/, helios/build.rs |
2 files, +16 | Benign — additive proto tags + one serde attribute |
helios/, docs/ prose |
4 files | Benign — documentation only |
Test fixtures (flare-cli/tests, helios/tests, scheduler/server tests) |
~15 files, +1 each | Benign — mechanical patch_features: 0 additions |
Detail
1. Conversation (pr_comments, 5 entries, oldest first)
flare-autobotcase-file notice with a link toautobot.eidonix.com. This is an external automated-review-service artifact. It contains no instruction directed at an agent and was not fetched (third-party page, not part of the PR's reviewable material).flare-autobotreview, "Changes Requested": blockers B1 (packing.rspatches_per_feature → widthlookup table encodes model identity), B2 (HF parity tests silently no-op when the env/venv is absent), B3 (atomic spans emitted from sharedmodel/prompt.rs), plus should-fix S1–S7 and 7 nits. Ordinary, technically substantive review prose.rickybrentreply: point-by-point resolution; explains that MiniMax's temporal duplication yields1176 = 3 * 2 * 14², which cannot be derived from3 * patch_size², hence the newpatch_featureswire field rather than a derivation.flare-autobotsecond review: no blockers; S1–S5 remaining; explicitly notes that large unrelated base-branch churn visible in the diff (RebuildManifest→PreparationManifest, banner removal,parallax) is not the author's and landed onmain.rickybrentreply: implements S1–S5 and discloses keepingpatch_size/pooling_kernel_sizeas wire fields deliberately (defense in depth, matching thePatchMergeImageSettingsprecedent).
Assessment. The only text that superficially reads as directive — e.g. "→ Put the width in prepared metadata", "→ Delete the first two" — is reviewer advice addressed to the human author, and the author's follow-up confirms it was implemented as code changes. No reviewer asks anyone (human or agent) to run commands, read secrets, change rules, or fetch remote content. Nothing attempts to impersonate a system or operator message.
2. New Python: fixture generation and tests
tests/frontend/generate_gemma4_image_fixtures.py(94 lines): imports limited tonumpy,torch,torchvision'sGemma4ImageProcessor,hashlib,json,argparse; produces deterministic pattern images and SHA-256 digests. No network, noeval/exec, nosubprocess.tests/frontend/gemma4_images.json(256 lines): processor and model configuration blocks plus 8 cases (width/height/seed/grid/tokens/patches and three SHA-256 digests each). Pure data; no instruction-like strings.tests/preparation/test_frontend_gemma4.py(257 lines): pytest tests writing synthetic snapshots intotmp_path, positive and deliberate negative cases (gemma4_unified12B rejection, missing envelope tokens, boolean token IDs), plus a provenance test for the checked-in fixture. Three cases read locally cached Hugging Face checkpoints at pinned revisions and skip when absent. Legitimate preparation testing.
3. ignition/preparation/
frontend.py(+70/−6): newprofile == "gemma4"branch that validates required fields through_expected()guards, accepts anymodel_type: "gemma4"/vision_config.model_type: "gemma4_vision"checkpoint, rejectsgemma4_unified, and verifiesimage_token,boi_token,eoi_tokenfromtokenizer_config.json(not opened) againsttokenizer.json(not opened) and optionalconfig.json(not opened) IDs. Tokenizer parsing usestokenizers.Tokenizer.from_fileon a local snapshot path — no remote fetch, and the code fails closed whentokenizer_configorsnapshotis omitted.image_settings()gained keyword-onlytokenizer_config/snapshotparameters.contract.py(+7/−1):visiondefaults gain"patch_features": 0, with a docstring documenting the override for non-1176Bracketedwidths.runtime_core_pb2.py(+170/−168): a regenerated descriptor blob. Imports are limited togoogle.protobuf.{descriptor,descriptor_pool,runtime_version,symbol_database,builder}and the call sites are the standard_builder.BuildMessageAndEnumDescriptors/BuildTopDescriptorsAndMessages. Noeval,exec, base64, pickle, or embedded code strings.
4. helios/src/frontend/images/gemma4.rs (new, 504 lines)
Genuine image-preprocessing implementation: SUPPORTED_SOFT_TOKENS = [70, 140, 280, 560, 1120]; Processor::load validates patch_size in 1..=64, pooling in 1..=16, pooling_kernel_size² == limits.patches_per_feature, and max_soft_tokens * pooling_kernel_size² <= limits.max_patches_per_image; geometry() performs an area-bounded antialiased bicubic resize; process() interleaves patches as (y, x, channel) with overflow-guarded arithmetic. The one environment-gated test is #[ignore]d, reads FLARE_GEMMA4_TEST_SNAPSHOT, and writes a temporary Jinja template whose cleanup is protected by a Drop guard. No shell-out, no network, no filesystem writes outside the test temp file.
5. Remaining Rust diffs
All mechanical and consistent with the description:
packing.rs/patch_merge.rs: thepatches_per_feature → widthlookup table is removed;Bracketedreads per-patch float width fromVisionCapabilities::bracketed_patch_features()(0→ legacy3 * 2 * 14² = 1176); merge stride derived via an integer-square-root check on any positive squarepatches_per_feature.mod.rs/conditioned.rs: unifiedImageProcessor::patch_features()dispatch (PaddedGrid = 1200,PatchMerge = 1176,Gemma4 = 768) andEnvelopehelper extraction.layouts/bracketed.rs(+model/prompt.rs): atomic span emission moved intolayouts::bracketed::prepare_input, gated onimage_tokens.span.is_some(), with bounds validation; the fallback block in sharedmodel/prompt.rsdeleted. The new span-bearing test isbracketed_layout_emits_atomic_spans_only_when_contract_declares_them.server/config.rs(+142/−2):validate_loaded_image_processor()checks processor patch width againstvision.bracketed_patch_features()(or nonzerovision.patch_featuresfor other layouts) and enforcesmax_image_envelope_tokens <= prefill_chunk_sizeand<= image_tokens.span.max_tokens, with boundary tests at 1088/1152 and 1121/1122.runtime_core/describe.rs: omitspatch_featureswhen0so legacy JSON stays byte-identical;runtime_core/protobuf.rs: Gemma 4 JSON mapping plus a round-trip test.model.rs(+15):patch_featuresfield,bracketed_patch_features()(0 → 1176),validate()rejecting nonzero widths that are not positive multiples of 3.model/contract.rs(+1/−1):Gemma4 = 11appended.model/tests.rs(+177): synthetic vision graph + manifest asserting 16×1176 staging plus negative rejections.
6. Proto and build
helios/proto/runtime_core.proto(+12):VisionCapacity.patch_features = 6,GEMMA4_IMAGE_PREPARATION = 11,ImageSettings.gemma4 = 11, newGemma4ImageSettingsmessage. Strictly additive tag allocation.helios/build.rs(+4): one#[serde(default)]attribute onVisionCapacity.patch_features.
7. Docs and fixtures
docs/TODO.txt(+8),docs/runtime-core-design.md(+14/−5),helios/README.md(+32/−10),helios/model-contract.md(+1/−1): prose describing the Gemma 4 profile, fixture provenance, and a qualification TODO item. No embedded directives or instruction-like text.- ~15 test files across
helios/src/scheduler/,helios/src/server/,flare-cli/tests/unverified_payload.rs, andhelios/tests/deepseek_requests.rseach add exactlypatch_features: 0(or the field in a struct initializer) — mechanical struct-literal updates.
8. Repository-wide sweeps
Regex searches at pr/483 for injection phrasing ("ignore previous", "disregard", "system prompt", "prompt injection", "autobot", "do not report") and for risky APIs (os.system, subprocess, eval(, base64, api_key, webhook, http(s)://) returned only pre-existing, unrelated repository content (e.g. .githooks/commit-msg, AGENTS.md (not opened) links, docs/api.md (not opened)). No new or touched file contains such constructs.
Additional cleanliness signals: no image or binary blobs added (the only new non-source artifact is a JSON fixture of hashes); no changes to CI workflows, secrets, permissions, or dependencies.
Open questions / what could not be verified
- External review-service links. Two
autobot.eidonix.comlinks in the conversation were deliberately not fetched, since they are third-party pages rather than part of the PR's reviewable material, and fetching them could leak PR context to a third party. They do not appear to carry instructions themselves; the PR material is self-contained, so this does not affect the verdict. - Live-checkpoint and HF-parity claims. The
#[ignore]d snapshot test requires a localgoogle/gemma-4-31B-it@842da379checkout, and three pytest cases require cached checkpoints; neither is exercisable at review time. This is a correctness-evidence limitation cited in the PR description, not a security concern — and the fixtures were checked in so parity is tested unconditionally under plaincargo test. - Diff noise from the base branch. The second automated review notes unrelated churn visible in the diff (
RebuildManifest→PreparationManifest, banner removal,parallax) that landed onmain, not from this author. It was reviewed as base-branch noise and is not a hidden change attributable to the PR. - Tooling note (not a defect). The code-search backend rejects
(?i)inline flags and look-around; case-insensitive sweeps required theignore_caseparameter and plain ERE. Recorded so a re-run is reproducible.
Conclusion: All Clear. No suspicious prompt injection or other items aimed at causing unwanted agentic behavior were found in PR #483.