Concepts

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

FieldTypeDescription
tsstring (ISO 8601)Timestamp of the model call
modelstringModel identifier, e.g. claude-opus-4-5
tokens_innumberInput / prompt token count
tokens_outnumberOutput / completion token count
cost_usdnumber | nullEstimated cost in USD
latency_msnumber | nullTime from request to first byte (ms)
session_idstring | nullSession this signal belongs to
user_idstring | nullDeveloper identity
project_idstring | nullProject context
error_codestring | nullAPI error code if the call failed; null on success
adapterstringAdapter 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

  1. The adapter intercepts the AI call (post-completion, via a hook or proxy)
  2. It extracts token counts, model name, latency, and cost from the API response
  3. It POSTs a signed JSON payload to the local agent at 127.0.0.1:6247/emit
  4. The agent validates the HMAC signature and the signal schema
  5. The Rule Engine evaluates all active rules against the signal
  6. The agent returns a response: { blocked: false } or { blocked: true, message: "..." }
  7. 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.

© 2026 UpgradIQ, Inc.Edit this page on GitHub