PHP Sessions
Use session start to establish identity and reusable defaults for policy, route, and risk.
PHP
$session = $client->session()->start([
'agent' => 'refund-agent',
'subject' => 'customer:42',
'metadata' => ['channel' => 'support'],
'policy' => ['ref' => 'policy/default', 'version' => '2026-02-27'],
'route' => ['provider' => 'openai', 'model' => 'gpt-4o-mini', 'region' => 'us-east-1'],
'risk' => ['score' => 22, 'decision' => 'allow']
]);Session Default Inheritance
- Session-level
policyandrouteare optional - If omitted in execute calls, DriftGate inherits from session
- If omitted in both places, backend org/workspace defaults apply
Operational Guidance
- Set
subjectfor tenant-level attribution - Store session ID for deterministic replay workflows
Last updated on