Integrate
SDKs & Reference Kit
Run a valid request and check that the service carried out the authorized effect. Then compare the cases your integration should refuse, including a repeated proof and a request whose details have changed. Keep results from the configured service for review.
First protected endpoint
The quickstart follows a first endpoint from setup to a valid request and a rejected replay. The timing is an onboarding target; actual completion depends on the reader environment and prerequisites.
Gate conformance checks
Five adversarial rows pair a request change with its expected named reject stage. The separate allow control requires one successful resource effect, and the replay check uses durable nonce state.
The examples use REST or JSON requests with an envelope that carries request-binding fields. Each integration documents its runtime, route policy, and service interaction.
On this page
Reference Kit
The Reference Kit provides a runnable path for assembling an envelope and sending it to Gate. Its examples show the allow path and selected rejects in the configuration where they are run.
What you get
- The prover path: canonicalize the request, challenge the circuit, respond, and assemble the envelope.
- The Gate path: recompute the binding server-side, burn the nonce before validate, then run twin validation.
- Client examples for request assembly. Check the repository documentation for the languages included in the current release.
- Examples that can be used with Verify to inspect selected reject stages.
Start with the quickstart if you are protecting one endpoint. Use the Reference Kit as a local comparison when checking whether a client still assembles the documented envelope fields.
What breaks and how to verify
If the allow path returns an error, compare the client and Gate versions, canonical request bytes, binding fields, policy, and ledger configuration. A local Reference Kit run and a staging Gate run may differ in any of those inputs.
Mechanism claims
Protected routes do not rely on a reusable API key, bearer token, or service certificate as the authority object.Reported testThe gate accepts a per-call envelope; agents and MCP faces are not configured with a bypass secret.Holds under the reference architecture
A conformance suite can falsify envelope assembly, binding, burn ordering, and reject stages against a deployment.Reported testVerify / adversary harness exercises allow path, replay reject, and named reject stages.
SDKs
A client library can assemble the envelope, and Gate middleware can enforce it in the application process. Confirm that both libraries are supported for the language and release you plan to use.
The Node middleware is the reference implementation available in evaluation today; other languages track the Reference Kit. If your service is not on Node yet, run Gate as a reverse proxy in front of it. The documented request contract is intended to be shared across form factors. Confirm compatibility between the selected client and Gate releases.
Gate middleware (Node)
The Node middleware runs in an Express-compatible application before the protected route handler (product details). Configuration includes an endpoint_id, the policy string, a freshness window, and a ledger endpoint. Gate checks the incoming envelope before calling the protected handler. The precise response depends on the configured reject behavior.
Client libraries
The client path challenges the circuit, forms a response, reserves a nonce, and fills the published binding fields. Pass+ provides the human-facing ceremony. Node is the evaluation reference implementation; other language examples are not represented here as supported SDKs.
Configuration surface
The configuration is assigned per protected endpoint:
- endpoint_id, the policy_hash source string, and the method allow-list for the route.
- TTL or use-count and the freshness window (how far tau can drift before Gate rejects).
- Behavior when the ledger is unavailable, including any documented emergency procedure.
- Audit mode, including whether the system records hashes or full request details.
Mechanism claims
Every envelope binds method, endpoint_id, request body hash, policy hash, tau, and nonce_uuid into one composite digest.Reported implementationrequest_hash = sha256(method || endpoint_id || request_body_hash || policy_hash || tau || nonce_uuid).Holds under the reference architecture
Model A (local validate-proof) and Model B (registry validate-proof) are security-equivalent at the envelope layer.Reported testThe client assembles the same envelope either way; only verifier acquisition differs.
Conformance suite
Conformance exercises the configured Gate integration against documented allow and reject cases, including envelope binding and nonce ordering. The suite records the release, environment, request, verdict, and resource effect.
Verify and the DEMO-HACK path exercise invalid or repeated requests against named reject stages. Compare the observed stages against the expected results, then record the release, configuration, and environment used for the evaluation.
Minimum checks
- Allow path: a valid envelope returns 2xx and the side effect happens exactly once.
- Replay: identical envelope bytes on a second attempt reject at the nonce stage.
- Body tamper without re-prove: mutated body against the original envelope rejects at the request-hash stage.
- Endpoint retarget: swapping endpoint_id to a different route rejects at the endpoint stage.
- Policy loosen: weakening the policy_hash rejects at the policy-hash stage.
- Stale tau outside the freshness window rejects at the freshness stage (when the server enforces a window).
How to run and verify
Run the suite in CI against a staging Gate connected to the durable ledger intended for deployment. An in-process test ledger does not show how nonce state behaves across process restarts or instances. Record the release, configuration, and environment with the results.
Mechanism claims
A conformance suite can falsify envelope assembly, binding, burn ordering, and reject stages against a deployment.Reported testVerify / adversary harness exercises allow path, replay reject, and named reject stages.
The nonce is burned before twin validation, so a failed or replayed submission cannot be spent twice.Reported implementationGate order spends nonce_uuid prior to validate-proof; spent nonces reject at the nonce stage.Holds under the reference architecture