Repository navigation
feat(advisor): default-off tiered decision advisor with v1-safe evidence - #54
Merged
Merged
Conversation
Bind advisor evidence without changing receipt v1. Store companion records in the receipt transaction. Block model adapters until the upstream API is verified. Signed-off-by: Shreyansh Sancheti <43677304+shreyanshjain7174@users.noreply.github.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Keep gateway params digests and sign separate advisor companions. Reject input failures instead of treating them as unavailable. Ignore payload task claims and verify exported record bindings. Signed-off-by: Shreyansh Sancheti <43677304+shreyanshjain7174@users.noreply.github.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Use the gateway state shape without spoofable task claims. Record conservative approval: 55% precision and 100% recall. Signed-off-by: Shreyansh Sancheti <43677304+shreyanshjain7174@users.noreply.github.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Reserve the internal producer ID so requests cannot poison history. Keep default exports readable by released v1 verifiers. Verify leading companions against signed manifest anchors. Signed-off-by: Shreyansh Sancheti <43677304+shreyanshjain7174@users.noreply.github.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Document the reserved identity and signed-anchor verification. Keep the record extension outside frozen v1 defaults. Signed-off-by: Shreyansh Sancheti <43677304+shreyanshjain7174@users.noreply.github.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Default v1 exports contain no advisor evidence lines. Keep chain verification usable without hiding unchecked evidence. Require advisor records when supplied or explicitly requested. Signed-off-by: Shreyansh Sancheti <43677304+shreyanshjain7174@users.noreply.github.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Plan
Phase 3 of the AgentGate scale-out prompt: a tiered local decision advisor. Off by default. It stays off until real model numbers exist.
What changed
internal/advisor.Advisorinterface, no-op, and HTTP client. The client has a strict timeout, a 64 KiB response cap, no redirects, no proxy, and loopback or.svc.cluster.localURLs only.risky: trueper action, default false. Every non-GET action in the shipped catalogs is tagged.AGENTGATE_ADVISOR_URLis set, and only after every deterministic check passes, before vault or upstream access.denywithadvisor_escalatedoradvisor_unavailable. A deny never becomes an allow (property test).advisor_unavailable(defaultallow_with_flag).advisor_input_rejectedand always escalate, so an agent cannot force a fail-open.{service, action, params}, marshalled without HTML escaping. A task claim inside params cannot raise confidence.params_sha256staysDigestParams(params)on every gateway receipt.Service=advisor,Action=decision:advise, and a reservedAgentKeyID=agentgate:advisorthat no API key can have. It is bound to its record throughHashRecordperDECISION.md.service=advisorordecision:*actions get 400 with no receipt. The registry rejects a service namedadvisor.mainbefore this PR, so released verifiers keep working.?records=1adds record lines.agentgate-verifychecks companion bindings when records are present, including a companion at the start of a range via the signed manifest anchor. On a default export it reports companions as unchecked.--require-advisor-recordsmakes missing evidence a failure.services/decision-advisor/. A stdlib Python service with/v1/decide,/healthz,/metricsand input limits.heuristic(deterministic, for tests and CI), plusonnxandvllm-sradapters. The adapters raiseNotImplementedErrorwith doc links, since the runtime APIs are not verified yet; no invented calls.bench/advisor/. 60 synthetic cases, labeled as synthetic since there are no real receipt logs yet.docs/spec/proposals/advisor-evidence.md(with the v2 field sketch), and aDECISION.mdnote on opt-in records. The RECEIPT-v1 §7 note is informative only.Numbers (heuristic backend only)
Validation
go build ./...: passedgo vet ./...: passedgo test -race ./...: passedsemgrep --config auto --error --quiet ./internal ./cmd ./pkg ./services: passedpython3 -m unittest discoverinservices/decision-advisor: 12 tests, passedReview
Four rounds by a second model (Claude Opus 5.5). Found and fixed:
params_sha256;