Skip to Content
SDKsJavaSessions

Java Sessions

Use session start to establish identity and reusable defaults for policy, route, and risk.

Java

var session = client.session().start(new SessionStartRequest()
  .agent("refund-agent")
  .subject("customer:42")
  .metadata(Map.of("channel", "support"))
  .policy(new PolicyRef("policy/default", "2026-02-27"))
  .route(new RouteRef("openai", "gpt-4o-mini", "us-east-1"))
  .risk(new RiskRef(22, "allow"))
);

Session Default Inheritance

  • Session-level policy and route are optional
  • If omitted in execute calls, DriftGate inherits from session
  • If omitted in both places, backend org/workspace defaults apply

Operational Guidance

  • Set subject for tenant-level attribution
  • Store session ID for deterministic replay workflows
Last updated on