Repository navigation
docs: Gate an agent's tools, synth --invalid negative tests, what DataContractGate is not - #466
Merged
Merged
Conversation
…lid negative tests, what DataContractGate is not)
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This branch was successfully deployed
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.
What
Docs only, plus one line in the existing docs drift test.
docs/integrations/gate-agent-tools.md: checking an agent's tool arguments and tool results against a contract (AISchemaGate and DataContractGate, same engine). Worked example with two contracts (an operation allowlist withcompliance_mode, and a result contract with a mask, a drop and leakage strip), HTTP, Python, TypeScript and MCP snippets, evidence viaX-Batch-Idand/quarantine/summary, and honest limits.contractgate synth --invalid: a script that fails unless every invalid row is rejected, and rejected for the rule it was built to break, plus a hand-written must-reject file.--invalidexists (RFC-117) and behaves as documented; the page also states what it cannot catch (a rule deleted from the contract, transforms and leakage).docs/integrations/README.md,docs/llms.txt,docs/llm-output-validation.mdand the README integrations line.tests/llm_docs_test.rs: the new page is added to the route drift gate (everyMETHOD /pathit cites must exist insrc/main.rs).No pricing, no plan numbers, no "Patent Pending", no em dashes.
cg diffis not mentioned (it is in the separate PR #465).Verified by running it
Against staging (
contractgate-api-staging.fly.dev, 0.4.2), with the contracts deployed to the demo org ascrm_lookup_argsandcrm_lookup_result:contractgate validate,synth(valid and--invalid),test,deploy-contract.enumandcompliance_modemakes the script fail.POST /egressallowed (200), refused (422,enum_violationplusundeclared_field), and result shaping (email masked,ssndropped,internal_notesstripped).aischemagateand TypeScript@nightmoose/aischemagatesnippets,dry_run.@nightmoose/contractgate-mcp-serveregress_validateover stdio.GET /quarantine/summarywith a run id.cargo test --test llm_docs_test.Not run: the CI workflow snippet on GitHub, live (
dry_run=false) gated calls (they would write audit rows into the shared database).Found while verifying (not fixed here):
contractgate test --format jsonwithout--quietprints per-record lines to stdout before the JSON, so the output does not parse. The page tells readers to use--quiet.