Skip to content

fix(policy-engine): fail closed unavailable FFI fetch limits - #4025

Merged
MohammadHaroonAbuomar merged 1 commit into
mainfrom
ricky-g-fix-acs-url-fetch-limits
Sep 18, 2026
Merged

MohammadHaroonAbuomar merged 1 commit into
mainfrom
ricky-g-fix-acs-url-fetch-limits

Conversation

@Ricky-G

Copy link
Copy Markdown
Contributor

Summary

Make the C ABI reject URL fetch-limit configuration when the pinned agent-control-spec release cannot enforce it. This prevents hosts from treating a success result as an outbound-fetch security control.

Problem

acs_builder_set_url_fetch_limits stored values that no dispatcher consumed, while returning success. The limits-aware upstream API is merged but has not been published in an eligible release, so accepting the configuration would remain misleading.

Closes #3942.

Changes

File What changed
policy-engine/sdk/rust/src/ffi.rs Preserve the ABI symbol but return a clear failure and remove the inert builder state.
policy-engine/sdk/rust/tests/upstream_compatibility.rs Add a regression test that verifies the setter fails with an explicit error.
policy-engine/docs/acs-retarget.md Document the fail-closed behavior and upstream adoption constraint.

Testing

  • cargo fmt --all -- --check
  • cargo clippy --locked --workspace --all-targets -- -D warnings
  • cargo test --locked --workspace with verified OPA v1.20.2 and AGENT_CONTROL_REQUIRE_OPA=1 (120 passed, 0 failed)

Reject URL fetch limit configuration until the pinned engine can enforce it, preventing callers from receiving a misleading success result.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Signed-off-by: Ricky Gummadi <ricky.gummadi@outlook.com>
@github-actions github-actions Bot added documentation Improvements or additions to documentation tests size/M Medium PR (< 200 lines) labels Sep 18, 2026
@github-actions

Copy link
Copy Markdown

PR Review Summary

Check Status Details
🔍 Code Review ⚠️ Missing No current-run comment
🛡️ Security Scan ⚠️ Missing No current-run comment
🔄 Breaking Changes ⚠️ Missing No current-run comment
📝 Docs Sync ⚠️ Missing No current-run comment
🧪 Test Coverage ⚠️ Missing No current-run comment

Verdict: ⚠️ AI review incomplete; ready for human review

AI review comments are untrusted advisory output. The summary reports workflow-generated completion status only, not model-authored pass/fail claims.

@github-actions

Copy link
Copy Markdown

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

@MohammadHaroonAbuomar MohammadHaroonAbuomar 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.

Verified at d85a4aa: the setter now fails before touching its arguments, the removed field was write-only on main (assigned at ffi.rs:551-556, never read), the new upstream_compatibility test fails against main's ffi.rs and passes with the fix, fmt/clippy clean, 68 tests pass, all checks green, commit signed off. The only in-repo ABI consumer never bound this symbol and acs_builder_from_url keeps its default budget, so nothing regresses.

One non-blocking follow-up: the comment at ffi.rs:250-252 still tells callers to tighten the budget with acs_builder_set_url_fetch_limits, which now always returns -1; worth rewording when the limits are actually threaded through after the upstream release.

@MohammadHaroonAbuomar
MohammadHaroonAbuomar merged commit 9165e49 into main Sep 18, 2026
142 checks passed
@MohammadHaroonAbuomar
MohammadHaroonAbuomar deleted the ricky-g-fix-acs-url-fetch-limits branch September 18, 2026 14:23
Yuvraj Singh (yuvrajsingh2428) pushed a commit to yuvrajsingh2428/agent-governance-toolkit that referenced this pull request Oct 1, 2026
…ft#4025)

Reject URL fetch limit configuration until the pinned engine can enforce it, preventing callers from receiving a misleading success result.

Signed-off-by: Ricky Gummadi <ricky.gummadi@outlook.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Signed-off-by: yuvrajsingh2428 <offcyuvi2428@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size/M Medium PR (< 200 lines) tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

policy-engine FFI: acs_builder_set_url_fetch_limits is write-only

2 participants