Use the hosted service

Govern tool calls by pointing the EVE client SDK at a hosted EVE endpoint. This is the default path for the pip and npm clients: they call a hosted service that runs the deterministic decision, and every decision fails closed on error.

Prerequisites

  • A reachable hosted EVE endpoint and an API credential for it (from your pilot; do not paste production credentials into examples).
  • The EVE client SDK (Python or TypeScript).

Installation

pip install ./eve_coreguard-0.2.2-py3-none-any.whl        # Python client
npm install ./eve-coreguard-0.1.0-rc1.tgz                 # TypeScript client (ESM, Node >=18)

Runnable code

Python:

from eve_coreguard import EVE

eve = EVE(policy="lending_v1", mode="hosted", api_key="eve_sk_...", endpoint="https://eve.internal.example/v1")
decision = eve.govern_tool_call(
    tool="loan_approval",
    arguments={"amount": 1000},
    context={"tenant_id": "acme", "principal_id": "agent-1", "session_id": "sess-1"},
)
# The hosted/sidecar client returns a plain dict (portable shape); read fields by key.
print(decision["action"], decision["allowed"])

TypeScript:

import { EVE } from "@eve/coreguard";

const eve = new EVE({ policy: "lending_v1", mode: "hosted", endpoint: "https://eve.internal.example/v1" });
const decision = await eve.governToolCall({
  tool: "loan_approval",
  arguments: { amount: 1000 },
  context: { tenantId: "acme", principalId: "agent-1", sessionId: "sess-1" },
});
console.log(decision.action, decision.allowed);

Provide the API credential through the client's configured auth mechanism, not by hard-coding it in source.

Expected result

  • Governed calls return ALLOW / BLOCK / MODIFY from the hosted service.
  • Identity (tenant, principal, session) is propagated to the service; in the MCP path, server-derived identity is authoritative.
  • A malformed service response results in a BLOCK, not a silent allow.

Evidence output

GovernanceResult{action: <...>, reason_codes: [...], decision_id: "...", certificate: {...}}

The certificate is signed (Ed25519 in production configuration, HMAC-SHA256 fallback).

Verification

Verify a hosted decision's evidence offline, without trusting the hosted server (see verify-evidence-offline.md):

import { verifyEvidence } from "@eve/coreguard";
console.log(verifyEvidence(decision.certificate, { publicKeyPem }).valid);

Failure example

If the hosted endpoint is unreachable or returns a malformed response, the client fails closed — Python raises, TypeScript returns a BLOCK. No client silently falls back to permissive behavior.

Production considerations

  • Hosted mode requires a reachable endpoint; design for network failure as a deny condition.
  • Keep API credentials out of source and logs; the client redacts secrets in structured output.
  • The TypeScript client never signs and holds no secrets; embedded mode is unsupported in TS.

Limitations

  • deploy.modes is PILOT_READY. Hosted mode requires a reachable endpoint. The pip/npm clients govern via hosted mode; embedded in-process evaluation is the EVE service, not the client wheel.
  • CoreGuard deterministic evaluation is PILOT_READY; the decision covers the governance verdict only. Independent verification of evidence needs the Ed25519 public key.

Next step

For enforcement that a direct call cannot bypass, use deploy-as-a-sidecar.md; for air-gapped use, see sovereign-offline-mode.md.

Part of the EVE AI Core control plane Deterministic AI Governance Control Plane → Policy decisions that return the same result for the same input every time, before execution.