Release SFTGuard v0.1 - #1
Conversation
|
You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool. What Enabling Code Scanning Means:
For more information about GitHub Code Scanning, check out the documentation. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 97bb02364c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| elif role == "assistant": | ||
| if not awaiting_assistant: | ||
| findings.append( | ||
| Finding("role_order", "error", split, line, record_sha256=record_sha256) | ||
| ) | ||
| awaiting_assistant = False |
There was a problem hiding this comment.
Preserve tool-result turns when checking role order
Records with the supported tool role in the common user -> assistant -> tool -> assistant shape are marked role_order here because awaiting_assistant is reset after the first assistant and a tool result never re-enables it. In that scenario the audit fails otherwise valid tool-using chat data even though tool is an allowed role; treat a tool turn as awaiting the follow-up assistant, or otherwise distinguish tool-call assistant turns from final answers.
Useful? React with 👍 / 👎.
| size = source.stat().st_size | ||
| if size > max_file_bytes: | ||
| raise InputError("JSON file exceeds the configured byte limit") | ||
| raw = source.read_bytes() |
There was a problem hiding this comment.
Bound contract reads before loading the whole file
When sftguard gate --contract is pointed at a FIFO/device, or at a regular file that grows after the stat, this read_bytes() happens before any enforced cap and can block or allocate far beyond max_file_bytes. That undermines the bounded-input guarantee for untrusted contracts; read at most max_file_bytes + 1 bytes from an opened regular file instead of loading the path wholesale.
Useful? React with 👍 / 👎.
What this adds
Frozen evidence
Protocol commit:
d4c74cefca6729124142635dc8893b5e3ddec2d3Implementation commit:
b0f168ab4d6a959d4e28611e345a250c14ca2ea9The one-shot frozen run produced:
Raw artifact SHA-256:
961b2842d7791f6f3af7bec5bce6105e433b68d41bf6f7b82a9f3a98e1f695abValidation
Claim boundary
This is internal detector regression evidence: each fault class uses one structural synthetic template across deterministic marker variations. It is not an external benchmark, a model-quality result, a safety certification, or proof of unknown-fault coverage.
Please merge with a normal merge commit (not squash) so the preregistration, frozen implementation, and evidence commits remain separately visible.