Skip to content

Model output and posting

Treat model responses like other untrusted input. Code Hawk validates format and target before making a GitHub write. Prompts tell the model to treat source and comments as evidence, and programmatic checks still apply if those instructions are ignored.

  • PR findings must fit the expected schema and point to eligible added lines. Suggestions are optional. A suggestion is dropped if it touches other lines, exceeds 10 lines or 2,000 characters, or contains an unsafe fence, marker, or mention. The underlying finding can still post without it.
  • Repository findings need a separate model's confirmation before filing. The summary includes what was unconfirmed or unchecked.
  • Replies are short, validated text. Code Hawk rejects bot loops and authorizes the human commenter before using the model.
  • Before posting, mentions are defanged. Hidden markers are controlled by Code Hawk: generated text cannot supply a trusted marker. When finding its existing comments, Code Hawk checks the marker and the bot identity. A completed review's marker carries the commit that a re-review can use as its checkpoint.

A candidate must be a valid, bounded unified diff with a matching test change and a change outside the tests. The fix stage denies protected paths, runs the new test before and after applying the rest of the diff, and emits a bounded record. It never receives the write token. The publish stage checks the record, trusted base, eligible issues, and path constraints again before creating a draft PR through the Git Data API. The draft still requires human review.

Read verified fixes for configuration and the trust model for job boundaries.