Directories
¶
| Path | Synopsis |
|---|---|
|
Package accounting is Cortex's own host for github.com/rossoctl/accountant: it computes context-savings figures with the same rules the context-guru proxy uses, following the host obligations in accountant/docs/cortex-wiring.md W6.
|
Package accounting is Cortex's own host for github.com/rossoctl/accountant: it computes context-savings figures with the same rules the context-guru proxy uses, following the host obligations in accountant/docs/cortex-wiring.md W6. |
|
facts
Package facts classifies which LLM provider a request went to, and gives the cache facts (accountant.EntryFacts) that provider's prompt cache has for a model.
|
Package facts classifies which LLM provider a request went to, and gives the cache facts (accountant.EntryFacts) that provider's prompt cache has for a model. |
|
push
Package push sends Cortex's accountant counters (llm.savings.*) to the central collector over OTLP/HTTP (design §5.10).
|
Package push sends Cortex's accountant counters (llm.savings.*) to the central collector over OTLP/HTTP (design §5.10). |
|
reqstats
Package reqstats pushes the llm.inference.* transport metrics (requests by status class, duration, time-to-first-byte, time the proxy added, request/response bytes) that core/accounting/metrics.go's per-request accountant data cannot provide, because that call site never sees an HTTP status, a wall-clock duration, or a byte count.
|
Package reqstats pushes the llm.inference.* transport metrics (requests by status class, duration, time-to-first-byte, time the proxy added, request/response bytes) that core/accounting/metrics.go's per-request accountant data cannot provide, because that call site never sees an HTTP status, a wall-clock duration, or a byte count. |
|
wire
Package wire reads an inference request body into the shape github.com/rossoctl/accountant hashes: tools, then system, then messages, one []byte per position, in the provider's cache order (accountant/docs/cortex-wiring.md W6.3).
|
Package wire reads an inference request body into the shape github.com/rossoctl/accountant hashes: tools, then system, then messages, one []byte per position, in the provider's cache order (accountant/docs/cortex-wiring.md W6.3). |
|
Package attribution decides which agent, process and session a request belongs to.
|
Package attribution decides which agent, process and session a request belongs to. |
|
Package auth composes core building blocks into HandleInbound and HandleOutbound — the two functions that all listeners call.
|
Package auth composes core building blocks into HandleInbound and HandleOutbound — the two functions that all listeners call. |
|
Package bootstrap holds process-level helpers shared by the authbridge binaries (cortex, cortex-envoy).
|
Package bootstrap holds process-level helpers shared by the authbridge binaries (cortex, cortex-envoy). |
|
Package bypass provides path pattern matching for skipping JWT validation on public endpoints (e.g., health probes, agent card discovery).
|
Package bypass provides path pattern matching for skipping JWT validation on public endpoints (e.g., health probes, agent card discovery). |
|
Package capabilities defines capability interfaces that protocol extensions implement to participate in framework services like content inspection, session bucketing, and summarization.
|
Package capabilities defines capability interfaces that protocol extensions implement to participate in framework services like content inspection, session bucketing, and summarization. |
|
Package clientstate owns the on-disk record agentop writes when it points an agent at Cortex, and which cortex reads back to check the agent is still pointed at the CA in force.
|
Package clientstate owns the on-disk record agentop writes when it points an agent at Cortex, and which cortex reads back to check the agent is still pointed at the CA in force. |
|
Package config provides YAML-based configuration with mode presets and startup validation for the AuthBridge auth layer.
|
Package config provides YAML-based configuration with mode presets and startup validation for the AuthBridge auth layer. |
|
cost
|
|
|
event
Package event is the canonical wire shape of the per-request cost that litellm-budget-track publishes onto a session event.
|
Package event is the canonical wire shape of the per-request cost that litellm-budget-track publishes onto a session event. |
|
ledger
Package ledger persists per-minute cost and token totals to disk so "what did today cost" survives a restart.
|
Package ledger persists per-minute cost and token totals to disk so "what did today cost" survives a restart. |
|
pricing
Package pricing owns model rates and the arithmetic that turns tokens into dollars.
|
Package pricing owns model rates and the arithmetic that turns tokens into dollars. |
|
pricing/internal/gen
command
Command gen regenerates the bundled price table from LiteLLM's public price map.
|
Command gen regenerates the bundled price table from LiteLLM's public price map. |
|
pricing/internal/pricegen
Package pricegen turns LiteLLM's public model_prices_and_context_window.json into pricing.Entry rows and renders them as Go source.
|
Package pricegen turns LiteLLM's public model_prices_and_context_window.json into pricing.Entry rows and renders them as Go source. |
|
pricing/pricelist
Package pricelist keeps vendor list prices current by downloading LiteLLM's public price map while the proxy runs, rather than only when the binary is built.
|
Package pricelist keeps vendor list prices current by downloading LiteLLM's public price map while the proxy runs, rather than only when the binary is built. |
|
settle
Package settle turns one response's facts into one settled cost.
|
Package settle turns one response's facts into one settled cost. |
|
usage
Package usage aggregates session events into fixed-width time buckets so a client can chart volume, errors, latency and cost over wall-clock time.
|
Package usage aggregates session events into fixed-width time buckets so a client can chart volume, errors, latency and cost over wall-clock time. |
|
Package fsutil holds file operations that need care on Windows.
|
Package fsutil holds file operations that need care on Windows. |
|
Package intent finds the text that a human typed in an agent's inference request.
|
Package intent finds the text that a human typed in an agent's inference request. |
|
internal
|
|
|
hostglob
Package hostglob is the one place cortex turns an operator-supplied host pattern into a matcher, and the one place that decides what counts as a dangerously broad pattern.
|
Package hostglob is the one place cortex turns an operator-supplied host pattern into a matcher, and the one place that decides what counts as a dangerously broad pattern. |
|
parsefixture
Package parsefixture runs a parser plugin over saved request and response pairs and compares the result with a golden file.
|
Package parsefixture runs a parser plugin over saved request and response pairs and compares the result with a golden file. |
|
parsercommon
Package parsercommon holds small helpers shared by the protocol parser libraries in core/parse (mcp, a2a, inference), the mcp-parser and inference-parser plugins, and the cpex plugin.
|
Package parsercommon holds small helpers shared by the protocol parser libraries in core/parse (mcp, a2a, inference), the mcp-parser and inference-parser plugins, and the cpex plugin. |
|
tztest
Package tztest loads real time zones for tests from a tz release pinned in this repository, never from the machine that runs them.
|
Package tztest loads real time zones for tests from a tz release pinned in this repository, never from the machine that runs them. |
|
wirefixture
Package wirefixture checks a handler's JSON against a shared fixture file.
|
Package wirefixture checks a handler's JSON against a shared fixture file. |
|
listener
|
|
|
egressallow
Package egressallow implements the forward proxy's deny-by-default destination allow list (#1483, MOCA MI1 §8.5): a sandbox may reach only the host:port entries the operator lists, and a request for anything else is refused by name — never left to time out — before DNS resolution and before any dial.
|
Package egressallow implements the forward proxy's deny-by-default destination allow list (#1483, MOCA MI1 §8.5): a sandbox may reach only the host:port entries the operator lists, and a request for anything else is refused by name — never left to time out — before DNS resolution and before any dial. |
|
egressguard
Package egressguard implements the forward proxy's SSRF dial guard (#1484, MOCA MI1 §8.5): resolve a destination once, refuse addresses a sandbox must never reach through the proxy, and dial the address that was checked — never a second resolution's answer.
|
Package egressguard implements the forward proxy's SSRF dial guard (#1484, MOCA MI1 §8.5): resolve a destination once, refuse addresses a sandbox must never reach through the proxy, and dial the address that was checked — never a second resolution's answer. |
|
extproc
Package extproc implements an Envoy ext_proc gRPC streaming listener.
|
Package extproc implements an Envoy ext_proc gRPC streaming listener. |
|
forwardproxy
Package forwardproxy implements an HTTP forward proxy listener.
|
Package forwardproxy implements an HTTP forward proxy listener. |
|
httpx
Package httpx contains the HTTP helpers shared across this repo's servers: the forward, reverse and ext_proc listeners, the stats and session APIs, and the agentop viewer's pprof surface.
|
Package httpx contains the HTTP helpers shared across this repo's servers: the forward, reverse and ext_proc listeners, the stats and session APIs, and the agentop viewer's pprof surface. |
|
httpx/pprofx
Package pprofx mounts Go's net/http/pprof handlers behind the browser defenses.
|
Package pprofx mounts Go's net/http/pprof handlers behind the browser defenses. |
|
internal/bodycount
Package bodycount counts the bytes a listener reads off an upstream response body, so every listener reports the same figure for the same response (#1309).
|
Package bodycount counts the bytes a listener reads off an upstream response body, so every listener reports the same figure for the same response (#1309). |
|
internal/bodyread
Package bodyread reports why buffering a request body failed.
|
Package bodyread reports why buffering a request body failed. |
|
internal/sessionevent
Package sessionevent builds the session rows every listener records for a request: Request and Response for one the pipeline let through, Deny and DenyResponse for one it rejected.
|
Package sessionevent builds the session rows every listener records for a request: Request and Response for one the pipeline let through, Deny and DenyResponse for one it rejected. |
|
internal/sseframe
Package sseframe reads complete Server-Sent Event frames off a streaming HTTP response body.
|
Package sseframe reads complete Server-Sent Event frames off a streaming HTTP response body. |
|
internal/tlssniff
Package tlssniff provides a net.Listener wrapper that detects whether each accepted connection is a TLS handshake or a plain HTTP request, and dispatches accordingly.
|
Package tlssniff provides a net.Listener wrapper that detects whether each accepted connection is a TLS handshake or a plain HTTP request, and dispatches accordingly. |
|
internal/wsframe
Package wsframe reads and writes RFC 6455 WebSocket frames for a proxy that relays a connection it also needs to read.
|
Package wsframe reads and writes RFC 6455 WebSocket frames for a proxy that relays a connection it also needs to read. |
|
reverseproxy
Package reverseproxy implements an HTTP reverse proxy listener.
|
Package reverseproxy implements an HTTP reverse proxy listener. |
|
skiphost
Package skiphost matches an outbound destination Host against an operator-configured pattern list to decide whether the listener should short-circuit — bypassing the plugin pipeline and session recording — and forward the request as a transparent proxy.
|
Package skiphost matches an outbound destination Host against an operator-configured pattern list to decide whether the listener should short-circuit — bypassing the plugin pipeline and session recording — and forward the request as a transparent proxy. |
|
transparentproxy
Package transparentproxy implements transparent (iptables-REDIRECTed) proxy listeners for proxy-sidecar mode.
|
Package transparentproxy implements transparent (iptables-REDIRECTed) proxy listeners for proxy-sidecar mode. |
|
vmcontrol
Package vmcontrol carries the per-VM listening socket from MOCA's vmpool to the Cortex forward proxy (#1477).
|
Package vmcontrol carries the per-VM listening socket from MOCA's vmpool to the Cortex forward proxy (#1477). |
|
Package llmclient is a small helper for calling OpenAI-compatible chat-completions endpoints from authbridge plugins.
|
Package llmclient is a small helper for calling OpenAI-compatible chat-completions endpoints from authbridge plugins. |
|
Package memstore provides a generic, process-scoped, TTL key→value store that plugins reach via pipeline.Context.Shared.
|
Package memstore provides a generic, process-scoped, TTL key→value store that plugins reach via pipeline.Context.Shared. |
|
claude
Package claude owns the Claude Code session-metadata contract: the shape agentop's harvester writes to ~/.cortex/session-metadata.json, the path it lives at, and the harvest that produces it.
|
Package claude owns the Claude Code session-metadata contract: the shape agentop's harvester writes to ~/.cortex/session-metadata.json, the path it lives at, and the harvest that produces it. |
|
parse
|
|
|
a2a
Package a2a parses A2A JSON-RPC 2.0 requests and responses from plain values.
|
Package a2a parses A2A JSON-RPC 2.0 requests and responses from plain values. |
|
inference
Package inference parses LLM inference requests and responses from plain values: Anthropic Messages, OpenAI Chat Completions and the Responses API.
|
Package inference parses LLM inference requests and responses from plain values: Anthropic Messages, OpenAI Chat Completions and the Responses API. |
|
mcp
Package mcp parses MCP JSON-RPC 2.0 requests and responses from plain values.
|
Package mcp parses MCP JSON-RPC 2.0 requests and responses from plain values. |
|
Package peerproc names the process at the other end of a TCP connection this process accepted, so a proxy on the same host can tell its clients apart by process rather than by what they claim in their requests.
|
Package peerproc names the process at the other end of a TCP connection this process accepted, so a proxy on the same host can tell its clients apart by process rather than by what they claim in their requests. |
|
Package placeholder defines the convention for opaque credential handles: a random "abph_" token the agent receives in place of the real Authorization value, plus the namespaced key used to store the real token in a shared store.
|
Package placeholder defines the convention for opaque credential handles: a random "abph_" token the agent receives in place of the real Authorization value, plus the namespaced key used to store the real token in a shared store. |
|
all
Package all registers the bundled plugins for every binary that imports it.
|
Package all registers the bundled plugins for every binary that imports it. |
|
contextguru
Package contextguru is an outbound AuthBridge plugin that compacts an agent's LLM request context before it is forwarded upstream, using the embedded github.com/rossoctl/context-guru engine.
|
Package contextguru is an outbound AuthBridge plugin that compacts an agent's LLM request context before it is forwarded upstream, using the embedded github.com/rossoctl/context-guru engine. |
|
cpex
Package cpex bridges AuthBridge requests through the CPEX (Context Plugin Execution) framework so operators can drive policy with CPEX's APL (Attribute Policy Language) DSL — or any of CPEX's built-in plugins (JWT identity, OAuth delegation, the Cedar, CEL and OPA decision points) — without writing Go code.
|
Package cpex bridges AuthBridge requests through the CPEX (Context Plugin Execution) framework so operators can drive policy with CPEX's APL (Attribute Policy Language) DSL — or any of CPEX's built-in plugins (JWT identity, OAuth delegation, the Cedar, CEL and OPA decision points) — without writing Go code. |
|
evolve
Package evolve connects Cortex to altk-evolve, a service that learns guidelines from agent trajectories (https://github.com/AgentToolkit/altk-evolve), using only the tools a stock `evolve-mcp --transport sse` server exposes.
|
Package evolve connects Cortex to altk-evolve, a service that learns guidelines from agent trajectories (https://github.com/AgentToolkit/altk-evolve), using only the tools a stock `evolve-mcp --transport sse` server exposes. |
|
ibac
Package ibac implements an Intent-Based Access Control plugin for authbridge.
|
Package ibac implements an Intent-Based Access Control plugin for authbridge. |
|
inferencerouter
Package inferencerouter is the inference-router plugin: it sends a coding agent's new sessions to the inference server chosen for that agent, and keeps every session on the server it started on.
|
Package inferencerouter is the inference-router plugin: it sends a coding agent's new sessions to the inference server chosen for that agent, and keeps every session on the server it started on. |
|
inferencerouter/routerconfig
Package routerconfig is the inference-router plugin's configuration: its shape, its validation, and the host rules the plugin routes by.
|
Package routerconfig is the inference-router plugin's configuration: its shape, its validation, and the host rules the plugin routes by. |
|
internal/hostmatch
Package hostmatch matches a request host against the bypass_hosts globs that ibac, sparc, cpex and lineage share.
|
Package hostmatch matches a request host against the bypass_hosts globs that ibac, sparc, cpex and lineage share. |
|
jwtvalidation/validation
Package validation provides JWT verification with JWKS-based key resolution.
|
Package validation provides JWT verification with JWKS-based key resolution. |
|
lineage
Package lineage provides the lineage-telemetry authbridge plugin.
|
Package lineage provides the lineage-telemetry authbridge plugin. |
|
litellm_budgettrack
Package litellm_budgettrack provides a pipeline plugin that tracks per-request cost and enforces a daily spending budget, rejecting requests with HTTP 429 when the budget is exceeded.
|
Package litellm_budgettrack provides a pipeline plugin that tracks per-request cost and enforces a daily spending budget, rejecting requests with HTTP 429 when the budget is exceeded. |
|
plugintesting
Package plugintesting exposes stub plugin adapters for listener tests that need to inject pre-built *auth.Auth instances (for example, with a mock verifier or a mock exchanger) without going through the real plugins' Configure path.
|
Package plugintesting exposes stub plugin adapters for listener tests that need to inject pre-built *auth.Auth instances (for example, with a mock verifier or a mock exchanger) without going through the real plugins' Configure path. |
|
script
Package script is the script plugin: it runs every executable file in a folder as a pipeline step, so a user can customize Cortex with a small Python or shell script instead of a Go plugin and a rebuild.
|
Package script is the script plugin: it runs every executable file in a folder as a pipeline step, so a user can customize Cortex with a small Python or shell script instead of a Go plugin and a rebuild. |
|
script/catalog
Package catalog is the script plugins Cortex ships: each folder under entries/ is one entry, which installed is one slot.
|
Package catalog is the script plugins Cortex ships: each folder under entries/ is one entry, which installed is one slot. |
|
script/internal/worker
Package worker runs one script as a long-lived child process and exchanges line-delimited JSON with it: one object per line on the child's stdin, one per line back on its stdout.
|
Package worker runs one script as a long-lived child process and exchanges line-delimited JSON with it: one object per line on the child's stdin, one per line back on its stdout. |
|
sessionbudget
Package sessionbudget enforces per-session lifetime budgets on tokens, inference calls, and wall-clock duration.
|
Package sessionbudget enforces per-session lifetime budgets on tokens, inference calls, and wall-clock duration. |
|
sparc
Package sparc implements a pre-tool reflection plugin for authbridge.
|
Package sparc implements a pre-tool reflection plugin for authbridge. |
|
staticinject
Package staticinject implements the static-inject outbound AuthBridge plugin: it swaps a placeholder credential on the outbound Authorization header for a real static credential, so a model-influenced workload never holds the real secret.
|
Package staticinject implements the static-inject outbound AuthBridge plugin: it swaps a placeholder credential on the outbound Authorization header for a real static credential, so a model-influenced workload never holds the real secret. |
|
tokenbroker/client
Package client provides an HTTP client for the Token Broker service.
|
Package client provides an HTTP client for the Token Broker service. |
|
tokenexchange/cache
Package cache provides a SHA-256 keyed token cache with TTL-based eviction.
|
Package cache provides a SHA-256 keyed token cache with TTL-based eviction. |
|
tokenexchange/exchange
Package exchange implements RFC 8693 OAuth 2.0 Token Exchange and client credentials grant.
|
Package exchange implements RFC 8693 OAuth 2.0 Token Exchange and client credentials grant. |
|
tokenexchangeaiac
Package tokenexchangeaiac is an outbound token-exchange plugin that needs no routes.
|
Package tokenexchangeaiac is an outbound token-exchange plugin that needs no routes. |
|
toolprune
Package toolprune removes unused tool definitions from outbound inference requests.
|
Package toolprune removes unused tool definitions from outbound inference requests. |
|
Package project names the project an agent process works in: the git repo root of its cwd.
|
Package project names the project an agent process works in: the git repo root of its cwd. |
|
Package redact provides best-effort stripping of sensitive values from JSON config payloads served by unauthenticated diagnostic endpoints.
|
Package redact provides best-effort stripping of sensitive values from JSON config payloads served by unauthenticated diagnostic endpoints. |
|
content
Package content finds secrets in content: the text of request and response bodies, SSE streams, and the text fields of session events (#1921).
|
Package content finds secrets in content: the text of request and response bodies, SSE streams, and the text fields of session events (#1921). |
|
Package reloader watches a config file and atomically swaps the inbound / outbound plugin pipelines when the file changes.
|
Package reloader watches a config file and atomically swaps the inbound / outbound plugin pipelines when the file changes. |
|
Package routing provides host-to-audience routing for token exchange.
|
Package routing provides host-to-audience routing for token exchange. |
|
Package session provides an in-memory session store for correlating inbound user intents with outbound tool calls across request boundaries.
|
Package session provides an in-memory session store for correlating inbound user intents with outbound tool calls across request boundaries. |
|
archive
Package archive persists sessions to disk so they survive a restart and the store's own eviction, and so agentop can browse them afterwards.
|
Package archive persists sessions to disk so they survive a restart and the store's own eviction, and so agentop can browse them afterwards. |
|
importer
Package importer writes sessions from an agent's own transcripts on disk into the session archive and the cost ledger, as sessions with the imported mark.
|
Package importer writes sessions from an agent's own transcripts on disk into the session archive and the cost ledger, as sessions with the imported mark. |
|
importer/bob
Package bob is the importer source for Bob (Bob Shell and Bob IDE).
|
Package bob is the importer source for Bob (Bob Shell and Bob IDE). |
|
importer/claude
Package claude is the importer source for Claude Code.
|
Package claude is the importer source for Claude Code. |
|
importer/codex
Package codex is the importer source for Codex.
|
Package codex is the importer source for Codex. |
|
importer/opencode
Package opencode is the importer source for OpenCode.
|
Package opencode is the importer source for OpenCode. |
|
importer/pi
Package pi is the importer source for Pi (pi.dev).
|
Package pi is the importer source for Pi (pi.dev). |
|
importer/sqlitecli
Package sqlitecli reads a SQLite database through the sqlite3 program, so that no module links a SQLite driver.
|
Package sqlitecli reads a SQLite database through the sqlite3 program, so that no module links a SQLite driver. |
|
timeline
Package timeline turns one session's events into spans on a time axis: which Claude Code agent was generating, which tool it was running, when a subagent was spawned and when its result came back, and which hosts the session talked to.
|
Package timeline turns one session's events into spans on a time axis: which Claude Code agent was generating, which tool it was running, when a subagent was spawned and when its result came back, and which hosts the session talked to. |
|
toolpair
Package toolpair pairs a session's tool calls with their results.
|
Package toolpair pairs a session's tool calls with their results. |
|
Package sessionapi exposes AuthBridge's in-memory session store over HTTP: JSON snapshots plus an SSE stream of live events.
|
Package sessionapi exposes AuthBridge's in-memory session store over HTTP: JSON snapshots plus an SSE stream of live events. |
|
Package sessionexport projects a session event to a flat, content-free record for post-processing outside the proxy.
|
Package sessionexport projects a session event to a flat, content-free record for post-processing outside the proxy. |
|
core/spiffe/consumer.go
|
core/spiffe/consumer.go |
|
filestore
Package filestore is a storage.Store kept in memory and saved to one file, for a single process that needs its plugins' state to outlive it: the laptop proxy, where a restart is routine and there is no redis.
|
Package filestore is a storage.Store kept in memory and saved to one file, for a single process that needs its plugins' state to outlive it: the laptop proxy, where a restart is routine and there is no redis. |
|
Package tlsbridge implements AuthBridge's outbound TLS bridge: it forges a per-origin leaf so the agent's egress TLS terminates at AuthBridge, the existing outbound pipeline runs on the decrypted request, and the call is relayed over a separately-verified upstream TLS connection.
|
Package tlsbridge implements AuthBridge's outbound TLS bridge: it forges a per-origin leaf so the agent's egress TLS terminates at AuthBridge, the existing outbound pipeline runs on the decrypted request, and the call is relayed over a separately-verified upstream TLS connection. |
|
Package tlsconfig builds *crypto/tls.Config values for authbridge's reverse-proxy and forward-proxy listeners using a SPIRE X.509 SVID source.
|
Package tlsconfig builds *crypto/tls.Config values for authbridge's reverse-proxy and forward-proxy listeners using a SPIRE X.509 SVID source. |
|
Package translate converts inference requests and replies from one protocol to another through the pivot type in package pivot.
|
Package translate converts inference requests and replies from one protocol to another through the pivot type in package pivot. |
|
anthropic
Package anthropic is the anthropic-messages translation protocol: the Anthropic Messages API.
|
Package anthropic is the anthropic-messages translation protocol: the Anthropic Messages API. |
|
chat
Package chat is the chat-completions protocol of the translation hub.
|
Package chat is the chat-completions protocol of the translation hub. |
|
pivot
Package pivot holds the protocol-neutral form of an inference request and reply, and the contract that each protocol package implements.
|
Package pivot holds the protocol-neutral form of an inference request and reply, and the contract that each protocol package implements. |
|
responses
Package responses is the responses protocol of the translation hub: the OpenAI Responses API that Codex sends.
|
Package responses is the responses protocol of the translation hub: the OpenAI Responses API that Codex sends. |
|
Package upstreamproxy sends Cortex's own egress through a parent HTTP proxy (listener.upstream_proxy).
|
Package upstreamproxy sends Cortex's own egress through a parent HTTP proxy (listener.upstream_proxy). |
Click to show internal directories.
Click to hide internal directories.