Requirements
- Linux kernel 5.10 or later with BTF (BPF Type Format) enabled
- systemd
- Root privileges for installation (required to load BPF programs)
BTF is required for CO-RE (Compile Once, Run Everywhere) compatibility. To check whether your kernel has BTF enabled, run
ls /sys/kernel/btf/vmlinux. If the file exists, your kernel is supported.How it works
The agent consists of two components:- eBPF programs — Seven BPF probes (tracepoints, kprobes, and OpenSSL uprobes) compiled with CO-RE for kernel 5.10+ portability. The probes track outbound TCP connections on port 443, measure bytes sent and received, and extract the TLS SNI hostname via OpenSSL uprobes attached to
libssl.so. The BPF programs never block connections — they only observe and record. - Rust daemon (
toktra-agent) — An async daemon that polls the BPF ring buffer, classifies events against known LLM provider hostnames, batches events (up to 50 events or 5 seconds), and transmits telemetry securely to Toktra over mTLS. The daemon runs as a systemd service.
The eBPF programs operate in observe-only mode. No BPF action ever drops or modifies a packet. All connections proceed normally.
Installation
- Debian / Ubuntu (.deb)
- RHEL / CentOS / Fedora (.rpm)
- From source
1
Download the package
Download the
.deb package from the Toktra admin dashboard under Devices → Download Agent → Linux.2
Install the package
systemctl daemon-reload && systemctl enable --now toktra-agent automatically.3
Verify the service is running
Installed paths
Configuration
The agent loads configuration by layering: defaults ←/etc/toktra/agent.conf ← environment variables. Environment variables always take precedence.
Configuration file
Create or edit/etc/toktra/agent.conf (TOML format):
Environment variables
All configuration keys can be overridden with environment variables. Add overrides to/etc/toktra/agent.env (loaded by the systemd unit via EnvironmentFile):
Device enrollment
On first run, the daemon automatically enrolls the device:- Generates an Ed25519 key pair and writes the private key to
/etc/toktra/device.key. - Sends a CSR to the Toktra enrollment endpoint.
- Writes the signed device certificate to
/etc/toktra/device.crt. The certificate is valid for 90 days. - Uses the device certificate for mTLS on all subsequent transmissions.
systemd service
The agent runs as aType=notify systemd service and signals readiness with sd_notify. The unit applies security hardening directives:
Prometheus metrics
The daemon exposes Prometheus-format metrics on127.0.0.1:9090/metrics (configurable with metrics_port). Scrape this endpoint with Prometheus or a compatible collector.
Available metrics:
Example Prometheus scrape config:
osquery extension (fleet-wide queries)
The agent ships a Go osquery table extension (toktra_extension) that exposes a toktra_connections virtual table. Use this with Fleet or Kolide to run fleet-wide LLM usage queries.
/run/toktra/connections.sock to read real-time connection data.
Example queries:
toktra_connections table schema: