Skip to content

feat: delegation chains, session traces, TUI polish#67

Merged
garagon merged 4 commits intomainfrom
feat/scan-profiles-tui-polish
Mar 18, 2026
Merged

feat: delegation chains, session traces, TUI polish#67
garagon merged 4 commits intomainfrom
feat/scan-profiles-tui-polish

Conversation

@garagon
Copy link
Copy Markdown
Contributor

@garagon garagon commented Mar 18, 2026

Summary

  • Delegation chains: Ed25519-signed delegation tokens with chained authorization (human -> agent-a -> agent-b), scope narrowing, and TTL enforcement. New delegate CLI command.
  • Ephemeral keys: Task-scoped keypairs that auto-expire, reducing blast radius of compromised keys. In-memory store with eviction loop.
  • Session traces: Reconstructs agent reasoning timelines from audit data. Dashboard page with tool call sequence, gaps, and reasoning capture.
  • Scan profiles & tool-scoped rules: Content-aware scanning profiles that adjust rule sensitivity per tool type. Tool policy rule overrides in config.
  • Verdict engine: Severity-based verdict mapping, scan profile support, and configurable per-agent overrides.
  • TUI improvements: Real-time mode sync from dashboard, accurate threat/blocked counting (including rejected), shortened status labels, live config reference.
  • Code cleanup: Deduplicated SQL column lists, extracted helpers, fixed struct alignment, added OrderASC query option.

Changed packages

audit, config, dashboard, gateway, hooks, identity, tui, verdict, commands

Test plan

  • make build passes
  • make test passes (all packages, race detector)
  • make lint passes (0 issues)
  • Delegation chain creation and verification (unit tests)
  • Ephemeral key issuance, expiry, and revocation (unit tests)
  • Verdict engine severity mapping (unit tests)
  • TUI live feed with enforce mode, quarantine, and rejected events
  • Session trace page renders in dashboard

garagon added 4 commits March 18, 2026 11:06
Delegation chain binding:
- Multi-hop delegation tokens with cryptographic chain verification
- VerifyChain() validates signature, expiry, scope narrowing, depth,
  parent linkage, and continuity across N hops
- X-Oktsec-Delegation header support in gateway middleware
- delegation_chain_hash persisted in audit trail
- CLI: oktsec delegate command for creating signed tokens

Reasoning chain capture:
- ToolEvent extended with reasoning, reasoning_hash, plan_step fields
- reasoning_log table (separate from audit_log for large data)
- LogReasoning/QueryReasoningBySession/QueryReasoningByAuditID methods
- SessionTrace builder reconstructs tool call timelines per session
- QueryOpts.SessionID filter for session-scoped queries

Ephemeral identity:
- EphemeralKeyStore: in-memory task-scoped Ed25519 keys with auto-eviction
- Issue/Verify/Revoke/RevokeByTask lifecycle management
- MaxPerTask and MaxTTL caps prevent key sprawl
- EphemeralConfig in identity configuration
Dashboard:
- Session Trace page (/dashboard/sessions/{id}) with vertical timeline,
  reasoning bubbles, threat highlighting, duration stats
- Event detail sidebar converted to tabs: Overview, Content, Forensics
- Authorization section shows delegation chain or "Direct" with
  registered-by and registration date
- Session column in events table with clickable links to trace
- SSE dynamic rows include session, latency, and rules columns

Exports:
- CSV export with session metadata header and step-by-step table
- SARIF 2.1.0 export for compliance tools (GitHub Security, Azure DevOps)
- JSON export for programmatic integration

Data model:
- delegation_chain column persists human-readable chain summary
- Timestamp parsing handles RFC3339Nano for duration calculation
- SessionID filter in QueryOpts for session-scoped queries
Pass live config pointer to TUI so it reads RequireSignature
on each render tick instead of using the initial value.
- Extract auditSelectCols constant to deduplicate SQL column lists
- Add OrderASC to QueryOpts, remove in-memory array reversal in trace
- Extract removeTaskFingerprint helper in ephemeral key store
- Fix struct field alignment in audit Entry and config map literals
- Add SetAuditStore to share single store between proxy and gateway
- Count rejected events as blocked in TUI, shorten quarantine label
@garagon garagon force-pushed the feat/scan-profiles-tui-polish branch from 059016d to 20b85df Compare March 18, 2026 14:09
@garagon garagon merged commit 3985f25 into main Mar 18, 2026
1 check passed
@garagon garagon deleted the feat/scan-profiles-tui-polish branch March 18, 2026 14:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant