Signals
A signal is a single telemetry event emitted by a FORG adapter after an AI model call. It contains metadata about the call — what model was used, how many tokens were consumed, how long it took, and how much it cost. Signals are the atomic unit of FORG data.
What a signal contains
| Field | Type | Description |
|---|---|---|
ts | string (ISO 8601) | Timestamp of the model call |
model | string | Model identifier, e.g. claude-opus-4-5 |
tokens_in | number | Input / prompt token count |
tokens_out | number | Output / completion token count |
cost_usd | number | null | Estimated cost in USD |
latency_ms | number | null | Time from request to first byte (ms) |
session_id | string | null | Session this signal belongs to |
user_id | string | null | Developer identity |
project_id | string | null | Project context |
error_code | string | null | API error code if the call failed; null on success |
adapter | string | Adapter that emitted this signal |
What a signal does NOT contain
FORG signals never include prompt text, completion text, file contents, code, or any other content from the AI interaction. Only metadata is collected. This is by design and enforced at the adapter level — adapters have no access to model I/O content.
Signal flow
- The adapter intercepts the AI call (post-completion, via a hook or proxy)
- It extracts token counts, model name, latency, and cost from the API response
- It POSTs a signed JSON payload to the local agent at
127.0.0.1:6247/emit - The agent validates the HMAC signature and the signal schema
- The Rule Engine evaluates all active rules against the signal
- The agent returns a response:
{ blocked: false }or{ blocked: true, message: "..." } - The signal is written to Supabase for analytics and the audit trail
Cost calculation
Some adapters (Claude Code, Cursor) receive cost data directly from the API response. When cost is not provided, FORG calculates it using the current pricing table for the model. Pricing tables are updated automatically from provider announcements.
Custom model pricing can be configured in Dashboard → Settings → Pricing → Custom models.