Policies
A policy is a rule that watches the event stream and takes an action when specific conditions are met. You define what to look for (conditions) and what to do about it (actions).Policy conditions
Each policy has a trigger type and one or more conditions that narrow when the policy fires. Trigger types:
Condition fields let you filter further — matching on risk level, user ID, department, token count, time of day, or model ID. Multiple conditions can be combined with AND (all must match) or OR (any must match).
Example: a policy that fires only for high-severity IP risk events from the Engineering department:
Policy actions
When a policy fires, it can take one or more actions:
You can stack multiple actions on a single policy — for example, create an incident and send an email to the manager.
Policy lifecycle
Policies are created as drafts and must be published to become active. You can test a policy against historical data before publishing — the test shows how many events in the last evaluation window would have triggered the policy. Active policies can be disabled without deleting them.Budgets
Budgets set limits on how many tokens — or how much money — a department or the whole organization can spend in a given period. When a budget is reached, Toktra can warn, alert, or hard-block further requests.Department hierarchy
Budgets are organized around your department hierarchy. Departments can be nested: a parent department’s budget is the aggregate of its children. If Engineering has a budget of 10 million tokens and has sub-departments (Backend, Frontend, Data), each sub-department has its own budget that rolls up to the Engineering total. You configure the hierarchy in Budget Management → Department Hierarchy. The dashboard shows a collapsible tree view of departments with live usage gauges.Soft caps vs. hard caps
Each budget can be configured as a soft cap or a hard cap.Budget rollovers
Budgets can be configured to roll over unused tokens month-to-month. You set a rollover cap percentage — for example, 50% means that up to half of the unused monthly budget carries forward. This prevents departments from losing tokens they didn’t use without incentivizing wasteful end-of-month spending. Rollover history is visible in Budget Management → Rollover History.Budget exemptions
When a hard cap blocks a user who has a legitimate need, they or their manager can submit a budget exemption request through the dashboard. Exemption requests route to an admin approver. Approved exemptions temporarily raise or lift the cap for the specified user and period. Manage exemptions at Budget Management → Exemptions.Exemption requests are logged in the audit trail regardless of outcome. Admins can see who requested exemptions, who approved them, and for what period.
Policies vs. budgets
Both policies and budgets can trigger alerts, but they serve different purposes:
In practice, most organizations use both: budgets to enforce overall spending limits, and policies to respond to specific events like IP risk detections or unusual usage spikes.