Trust: Audit, Security and AI Governance
Admin › Trust has seven tabs:
| Tab | What it answers |
|---|---|
| Audit log | Who changed which setting, user, model, agent, API, knowledge base or tool. Who signed in, failed to sign in, or signed out. |
| AI activity | Every model call: who, from which application, which model, which tools and data it used, how many tokens, the cost, and whether it failed. |
| Security | Failed sign-ins, guardrail blocks, refused uploads, API keys used from new addresses; alert rules; shadow AI found in your proxy logs. |
| Guardrails | What each application does with prompt injection and personal data, and which chat tools ask before they run. |
| Inventory | Every AI asset, its owner, last use, the data it touches, its risk tier and license; what uses a piece of data; how models changed. |
| Reports | AI use by department, answer quality, the evidence pack for an auditor, and archived agent runs. |
| Settings | Who must use two-step sign-in, whether AI activity keeps prompt and response text, quality sampling and retention. |
Only admins can open it. For a task-by-task guide to the audit records, see the Audit section.
Audit Log
One row per change or sign-in event. Each row records:
- who (a user, an API key, or the system);
- from which address and browser;
- what changed: the record's state before and after, plus a one-line summary.
What is recorded
| Area | Changes recorded |
|---|---|
| Agents | Workflows, skills, automations, data sources and catalog secrets (name only) |
| APIs | API definitions, their lifecycle and versions, and the gateway settings |
| Chat | Models (create, edit, access, delete); knowledge bases and their files; Tools and Functions, including their code; usage limits; deleted chats (title and owner only, never the messages); refused uploads |
| Voice | Voice agents, deployments, review policies and settings |
| Platform | Users (role, details, password changed, deleted); groups and their members; every setting changed in Admin › Settings; sign-ins (with the method: password, LDAP, SSO, two-step); failed sign-ins; sign-outs; API keys created or deleted; two-step sign-in turned on, off or reset; SCIM provisioning |
Secrets never reach the log. Any field whose name marks it as a secret (a key, token, password, secret, header or webhook) is stored as set or not set. Token-shaped strings and credentials in URLs are hidden too. A changed secret shows in the summary as api_key: changed.
Tools and Functions keep their code (up to 200 KB, else its SHA-256), because they run on the server with full rights.
Searching and exporting
- Filters: application (Agents, APIs, Chat, Voice, Platform), action, period and text. Click a row to see its before and after.
- Export CSV or JSON: downloads the filtered rows (at most 100,000) with their chain fields. The file's SHA-256 is shown and sent as the
X-Content-SHA256header: keep it with the file as evidence that it hasn't changed since.
Tamper evidence
The audit log is one hash chain.
- Each row is sealed, within seconds of being written. It gets:
- a sequence number;
- the hash of the row before it;
- its own SHA-256 over all its fields.
- Any change shows: changing a row, removing one or inserting one breaks the chain.
- Verify: the Audit log tab shows Chain verified, or the first broken record and why.
- Daily checkpoint: once a day, the latest hash is kept as a checkpoint. Set
AUDIT_ANCHOR_WEBHOOK_URLand it is also POSTed outside Studio, for example to your SIEM:{"kind": "hrida-audit-anchor", "seq": …, "entry_hash": "…", "at": …}. - PostgreSQL: a database trigger refuses any change to a sealed row.
- Retention: rows older than
AUDIT_LOG_RETENTION_DAYS(2555 days, about 7 years) are removed from the start of the chain only. A checkpoint keeps the last removed row's hash, so the rest still verifies.
Someone with full access to the database can still delete rows, checkpoints or the trigger. They can't do it unnoticed when the daily anchors are kept somewhere they can't reach, such as AUDIT_ANCHOR_WEBHOOK_URL or the exports you keep.
AI Activity
One row for every model call in Studio, in every application:
| Application | Calls recorded |
|---|---|
| Chat | Chats, temporary chats, channels, the OpenAI-compatible API (with or without a chat), and background tasks such as titles, tags and follow-ups |
| Automations | Their runs' model calls |
| Agents | Every LLM call of Agent Builder runs and skill tests, with the run and workflow |
| Voice | Each turn of a call, scenario tests and the post-call summary, with the session and voice agent |
| Assistants | The API Builder assistant and the Admin Assistant |
| API gateway calls | The API Builder gateway's own call log (these calls use no model) |
Each row records:
- the user, the time, the model and its provider;
- the chat, run or session;
- the tools the model called, and the knowledge bases and files attached;
- prompt and completion tokens, and the cost (from Model Pricing);
- the time taken, the caller's address, and the error if the call failed.
Deleting chats doesn't touch it. So usage limits are counted from AI activity, and a user can't reset a limit by deleting chats. Background tasks (titles, tags, follow-ups) are recorded but don't count toward limits, as before.
Prompt and response text are not kept by default. Turn on Keep the prompt and the response of each model call in Settings when your audits must show what was asked and answered. Each is kept up to 20,000 characters, and cleared after the number of days you set. The rest of the row stays until AI_USAGE_RETENTION_DAYS (400 days).
Export CSV downloads the filtered rows, with their SHA-256.
Two-Step Sign-In
Password and LDAP sign-ins can ask for a second step: a 6-digit code from an authenticator app (Microsoft Authenticator, Google Authenticator, 1Password and others).
- Turning it on: each person can set it up in Settings › Account › Two-step sign-in. They scan the QR code, enter a code, and save the 10 recovery codes shown; each recovery code works once.
- Requiring it: in Admin › Trust › Settings, choose Admins or Everyone. Anyone covered who has no app yet is asked to set one up at their next sign-in, before they get in.
- Signing in: after a correct password, Studio asks for the code. Each code works once. A failed code is audited, and attempts are throttled.
- Lost phone: an admin opens Admin › Users, edits the person and clicks Reset two-step sign-in. The reset is audited.
- SSO: company-account sign-ins (OIDC, Microsoft, Google) rely on the identity provider's own MFA.
API Keys
A user's API key (sk-…) is stored only as its SHA-256, plus an encrypted copy for Functions and Tools that call Studio as the user. The key is shown once, when it is created. After that, Settings › Account shows only how it starts and ends; if it is lost, create a new one. Keys created before this release keep working: they are converted on upgrade.
Upload Checks
Every upload is checked on the server before it is stored:
- Size: the Max Upload Size of Admin › Settings › Documents (
RAG_FILE_MAX_SIZE, in MB), now enforced by the server as well as the browser. - Types that run code: executables and scripts (
.exe,.dll,.bat,.ps1,.vbs,.jar,.lnkand more) are refused. So are documents with macros (.docm,.xlsm,.pptm…), unlessFILE_ALLOW_MACRO_DOCUMENTS=true. - Viruses: set
CLAMAV_HOSTto scan every upload with ClamAV. An infected file is refused. When the scanner can't be reached, uploads are refused until it is back, unlessCLAMAV_FAIL_OPEN=true.
Each refusal is in the audit log. To run ClamAV next to Studio:
clamav:
image: clamav/clamav:stable
restart: unless-stopped
volumes:
- clamav-db:/var/lib/clamav
# and on the Studio service:
# environment:
# CLAMAV_HOST: clamavGuardrails
Built-in checks on what goes into and comes out of the models, in every application. They work without a builder adding anything; an Agent Builder guardrails node can still add its own.
| Check | What it looks for |
|---|---|
| Prompt injection | Text that tries to override instructions, reveal the hidden prompt, change the AI's role or make it misuse tools: patterns, and optionally an AI check |
| Personal data | Card numbers (with a Luhn check), Aadhaar, PAN, email addresses and Indian phone numbers: the API gateway's masking presets |
| Tool and API results | Instructions hidden in a web page, file or API answer that a tool returned |
| Retrieved documents | Instructions hidden in the knowledge or files given to a chat model |
For each application and check, choose what happens:
| Action | Effect |
|---|---|
| Off | Not checked |
| Flag | A security event is recorded and the text goes through. For a tool result or documents, a note telling the model it is data, not instructions, is put first (not for JSON, which must stay parseable). |
| Redact | Personal data only: masked, then the call goes on |
| Block | Refused. A chat message gets This was blocked by your organization's AI policy; an agent run fails with that reason; a voice caller hears a short apology; a tool result or documents are withheld from the model. |
Where they run:
- Chat: chats, assistants, automations and the OpenAI-compatible API. The person's own message is checked, not the documents the platform added. An answer that isn't streamed is checked before it is returned. A streamed answer is already on its way, so it can only be flagged.
- Agents: the run's input is checked once, when the run starts. Each model call's prompt is the builder's template around that input, so it is checked only for personal data. Every tool result is checked.
- Voice: what the caller says, and the agent's answers. The summary after a call isn't checked.
- API: API Builder responses that agents read are checked as tool results.
Defaults: injection, tool results and documents are flagged; personal data is off. Background tasks (titles, tags), direct connections and the platform's own checks aren't checked.
The AI check for injection asks a model whether a message tries to take it over, when the patterns found nothing. Choose its model under Model for the AI check (empty: the default model), and click Test to see that it answers.
When the AI check can't answer (its model failed, the provider is down, or it answered neither yes nor no), If the AI check cannot answer decides:
- Let the message through (the default);
- Flag the message: it goes through with a flag. It is never blocked because the check failed.
Either way, a warning is logged and a high-severity Guardrail AI check could not answer security event is recorded, at most one per 10 minutes, so a broken check doesn't go unnoticed.
Try it: the Try the saved policy box shows what the policy would do with a text, without recording anything.
Tools that ask first
Chat tools in this list ask the person before they run: a dialog in the chat shows what the tool would do and its arguments (secrets hidden). The tool runs only if the person allows it. By default: send_email, execute_code, delete_automation, delete_calendar_event.
When no one can be asked (the OpenAI-compatible API, automations, a closed tab), When no one can be asked decides: Run the tool (the default) or Don't run it. A declined or unanswered call is a security event, and the model is told the tool wasn't run.
Security
Security events are recorded as they happen:
| Event | Severity | When |
|---|---|---|
| Failed sign-in | low | A wrong email or password, or a failed LDAP sign-in |
| Wrong second-factor code | medium | A wrong authenticator or recovery code |
| Sign-ins throttled | medium | Too many attempts for one account (one event per 5 minutes) |
| Blocked, flagged or redacted by the guardrails | high, medium, low | See Guardrails |
| Guardrail AI check could not answer | high | The AI check for injection couldn't judge a message (one event per 10 minutes) |
| Tool not allowed | low | A tool that asks first was declined or not answered |
| Upload refused | medium (high for a virus) | See Upload checks |
| API key from a new address | medium | A user's API key used from an address it was never used from (not the first one) |
| Alert fired | high | An alert rule fired |
| Shadow AI | medium | See Shadow AI |
The tab shows the totals by severity, the most frequent events, and the list, filtered by event and period. Click an event for its details. Events are kept for 365 days (Keep security events for in Settings).
Alerts
Alert rules watch a metric over a window and fire when it is above a threshold:
| Application | Metrics |
|---|---|
| Agents | Failed runs (%, once there are at least 5 runs); runs stopped by a loop or the time limit; run cost (USD). Optionally for one workflow. |
| Voice | Reply time (95th percentile of calls, ms); handoffs to a person; calls ended by an error or dropped. Optionally for one voice agent. |
| Chat | Messages blocked by the guardrails; chat cost (USD), optionally for one model |
| Platform | Failed sign-ins and second-factor codes; high-severity security events |
- Checked every minute, by one Studio replica at a time.
- Fires at most once per cooldown, to a pop-up for every admin signed in, a webhook (Slack, Microsoft Teams, Google Chat, Discord or plain JSON) and email (through the instance's SMTP account).
- Each firing is a security event. Check now shows the metric's current value; Send a test sends a test alert to the rule's channels.
API Builder alerts stay in the API Builder, per API.
Shadow AI
AI services people use outside Studio. Upload a log, and each person or address reaching a public AI service is a finding:
- Proxy, DNS or firewall logs: CSV with a host, domain or URL column (and a user or client address column), JSON lines with the same fields, or plain text lines.
- The Computer egress log:
docker logs computer-egress(squid's access log). Each Hrida Computer's traffic goes through it.
Studio's own model connections aren't findings, and neither are the hosts you list as sanctioned (your approved AI services). Each finding (who, service, hosts, requests, last seen) is a security event. Each import is kept with its findings and the log's SHA-256.
Inventory
Every AI asset in Studio, by application:
| Application | Assets |
|---|---|
| Agents | Workflows, skills, automations |
| API | API Builder APIs, and the data sources their operations serve |
| Chat | Custom models and assistants (digital employees among them), and tools |
| Voice | Voice agents |
| Computer | Each person's Hrida Computer |
For each one, Studio shows:
- its owner, status, version and when it was last used;
- the data it touches: knowledge bases, files, data sources, skills and base models.
Admins record the rest. Click an asset to set:
- its risk tier: minimal, limited, high or unacceptable, the EU AI Act's tiers. Until it is set, a suggestion is shown: limited for what talks to people or reaches your data, minimal otherwise. The suggestion is only a starting point.
- its license and a link to its terms;
- the kinds of data it handles, its purpose and notes;
- Save and mark reviewed, to record who reviewed it and when.
Each change is in the audit log.
Lineage: under an asset, pick one of its data items to see everything else that uses it:
- For a file, this includes what uses the knowledge bases the file is in.
- For a data source, it includes the workflows in the Agent Builder spaces allowed to query it.
Model change history: every model created, edited, shared or deleted, and every change to the model connections (base URLs, keys, defaults), from the audit log.
Reports
AI use by department
Give each group a Department (Admin › Users › Groups › edit a group). The report adds up each person's AI activity under their groups' departments: people, model calls, tokens and cost. Someone in groups of two departments counts in both; someone in none is under No department.
Answer quality
A judge model scores a sample of chat answers that used documents (knowledge, files, web results):
- relevance: does the answer address the question;
- groundedness: is what it states supported by the documents.
Each score is from 0 to 1. Set the share of answers to score, and the judge model, in Settings (0, the default, turns it off). Pick the judge from the chat's models and click Test to see that it answers; while it can't, answers go unscored and a warning is logged. Each scored answer is one more model call, in the background, recorded in AI activity. The report shows the averages per model and the latest scores, with the judge's reason.
Evidence pack
Download a ZIP for a period, for an auditor:
| File | Contents |
|---|---|
audit_log.csv | The period's audit rows with their chain fields |
audit_chain.json | The chain check over those rows, and the checkpoints |
approvals.csv | Review decisions in agent runs, workflow and API lifecycle steps, voice agent reviews |
inventory.json | The AI inventory with what admins recorded |
policies.json | The guardrails, tool approval, two-step sign-in, retentions, usage limits and alert rules in force |
security_events.csv | The period's security events |
usage.json | Calls, tokens and cost per application and model, and per department |
quality.json | Daily quality scores |
framework_mapping.md | What each file evidences in the EU AI Act, ISO/IEC 42001 and India's DPDP Act |
manifest.json | The period, who made it, and each file's SHA-256 |
The ZIP's own SHA-256 is shown, and each download is in the audit log.
The pack is evidence for an assessment, mapped to the clauses it supports. It is not a certification or a legal opinion: which obligations apply depends on each AI system's role and risk class.
Archived agent runs
Agent runs older than EXECUTION_TRACE_RETENTION_DAYS (90 days) are archived before they are deleted. Each UTC day becomes one gzip JSON-lines file (the runs, their steps and costs), recorded with its SHA-256. The files go where the API gateway call-log archives go: under agent-runs/ in your storage provider (S3, GCS, Azure), or in DATA_DIR. A day is deleted only once it is archived. The identity-provider token on a run is never archived, and secrets in a run's saved state are hidden. EXECUTION_TRACE_ARCHIVE=false turns archiving off.
Deleting a workflow deletes its runs, so they are archived first, as one file listed as Deleted workflow. If they can't be archived, the workflow isn't deleted: try again once the storage is back.
With local storage, an archive is written to the data volume of the replica that made it. On a cluster with a volume per replica, use S3 (or GCS or Azure) storage, so every replica can read the archives.
Reconstructing a Run
Each agent run now records what exactly it ran:
- the workflow's version and its published snapshot;
- a SHA-256 of the graph it was given (a draft has no snapshot);
- the version of each skill its nodes used.
The reason for each branch is recorded in the run's steps. The class a classify node picked, an if/else verdict, a guardrails node's PASS or FAIL, and a loop stopped at its maximum all become decision steps. Before, they were only in OpenTelemetry.
Pauses, errors and decisions are written reliably: in order, with one retry. Node starts are still written in the background.
Connection Keys at Rest
Saved settings that are keys, secrets, passwords or tokens are stored encrypted in the database. This covers:
- the OpenAI-compatible connection keys;
- the web search, speech, image and document-loader keys;
- OAuth client secrets and the LDAP app password;
- keys inside tool server connections.
The encryption key comes from HRIDAAI_SECRET_KEY. Values saved before this release are read as they are, and encrypted the next time settings are saved.
If HRIDAAI_SECRET_KEY changes, the saved keys can't be decrypted. Studio logs which setting failed, and the connection fails until the key is entered again. Every Studio service (the gateway and voice services too) needs the same HRIDAAI_SECRET_KEY.
CONFIG_ENCRYPT_SECRETS=false stores the keys plain again from the next time settings are saved, if you need them readable outside Studio.
Rolling back to an earlier release: 1.3.0 changes the database (API keys are stored hashed, connection keys encrypted, new tables), and an earlier release can't run on it. Back up the database before you upgrade, and restore that backup to roll back.
Cost and Limits
- Agent run cost comes from Model Pricing, like chat cost. A model with no price falls back to the old rough estimate.
- Usage limits count agent runs too, not only chat and automations. A run started by someone over a hard limit is refused, like their chat would be.
- Catalog budgets: when a catalog passes its alert threshold (runs, tokens or cost), admins get a pop-up and a security event, once a month.
- Voice calls show their cost in USD in the voice agent's analytics:
- the model's part, from Model Pricing;
- speech at the prices you set in Admin › Settings › Voice Agents › Speech prices (0 for self-hosted speech).
Supply Chain
Studio's build pipeline checks what it ships:
- pip-audit: the pinned Python requirements against the PyPI advisory database, on every change to them and weekly.
- Trivy: the Studio and gateway images just built, for critical and high vulnerabilities that have a fix.
- Image signing: with cosign and a key pair. Nothing is written to the public transparency log.
To turn signing on, create a key pair (cosign generate-key-pair). Store the private key and its password as the repository secrets COSIGN_PRIVATE_KEY and COSIGN_PASSWORD. Then verify an image before you deploy it:
cosign verify --key cosign.pub --insecure-ignore-tlog ghcr.io/<owner>/<image>@sha256:<digest>Accepted findings go in .github/pip-audit-ignore.txt and .trivyignore, one ID per line with the reason.
Settings
| Setting | Default | |
|---|---|---|
| Two-step sign-in required for | Nobody | TRUST_MFA_REQUIRED: off, admins or all |
| Keep the prompt and the response | Off | TRUST_RECORD_PROMPT_TEXT |
| Clear the text after | 90 days | TRUST_TEXT_RETENTION_DAYS |
| Score answer quality | 0% (off) | TRUST_QUALITY_SAMPLE_PERCENT; the judge: TRUST_QUALITY_MODEL_ID (empty: the default model) |
| Keep security events for | 365 days | TRUST_SECURITY_RETENTION_DAYS (30 to 3650) |
| Guardrails | See Guardrails | TRUST_GUARDRAILS |
| Tools that ask first | send_email, execute_code, delete_automation, delete_calendar_event | TRUST_TOOL_APPROVAL (comma-separated); TRUST_TOOL_APPROVAL_UNATTENDED: allow or deny |
These are ConfigVars: set once from the environment, then changed here. Changing them is audited.
Environment variables
| Variable | Default | Meaning |
|---|---|---|
AUDIT_LOG_RETENTION_DAYS | 2555 | How long audit rows are kept |
AUDIT_ANCHOR_WEBHOOK_URL | — | Where the daily chain checkpoint is POSTed |
AI_USAGE_RETENTION_DAYS | 400 | How long AI activity rows are kept |
TRUST_MFA_REQUIRED | off | off, admins or all |
TRUST_RECORD_PROMPT_TEXT | false | Keep prompt and response text |
TRUST_TEXT_RETENTION_DAYS | 90 | When that text is cleared |
CLAMAV_HOST / CLAMAV_PORT | — / 3310 | ClamAV's clamd |
CLAMAV_TIMEOUT_SECONDS | 30 | One scan's time limit |
CLAMAV_FAIL_OPEN | false | Store uploads when the scanner is down |
FILE_BLOCKED_EXTENSIONS | executables and scripts | Replaces the list of refused types (comma-separated) |
FILE_ALLOW_MACRO_DOCUMENTS | false | Let documents with macros through |
TRUST_QUALITY_SAMPLE_PERCENT | 0 | Share of answers with documents to score |
TRUST_QUALITY_MODEL_ID | — | The judge model: any model from the chat's model list (empty: the default model) |
TRUST_SECURITY_RETENTION_DAYS | 365 | How long security events are kept |
TRUST_TOOL_APPROVAL | send_email, execute_code, delete_automation, delete_calendar_event | Chat tools that ask first (comma-separated) |
TRUST_TOOL_APPROVAL_UNATTENDED | allow | allow or deny when no one can be asked |
EXECUTION_TRACE_RETENTION_DAYS | 90 | When agent runs are archived and deleted |
EXECUTION_TRACE_ARCHIVE | true | Archive agent runs before deleting them |
CONFIG_ENCRYPT_SECRETS | true | Store saved connection keys encrypted (false: plain again from the next save) |
API
All admin-only, under /api/v1/trust:
| Method | Path | |
|---|---|---|
GET | /audit | Rows, with application, action, resource_type, actor_id, since, until, q, limit, offset |
GET | /audit/export?format=csv|json | The filtered rows; X-Content-SHA256 is the file's hash |
GET | /audit/verify | The chain recomputed: ok, verified, broken |
GET | /audit/checkpoints | Purge and daily checkpoints |
GET | /activity | AI activity rows; application=api lists API gateway calls |
GET | /activity/summary | Calls, tokens, cost and errors per application and model |
GET | /activity/export | CSV of the filtered rows |
GET / POST | /settings | The settings above |
GET | /security/events, /security/summary | Security events (kind, severity, application, since); totals per kind, severity and day |
GET / POST | /guardrails | The policy and tool approval; POST /guardrails/test tries a text |
GET / POST | /alerts, /alerts/{id} | Alert rules and their metrics; DELETE /alerts/{id}; POST /alerts/{id}/check?send=true |
GET | /quality | Quality scores per day and model, and the latest |
GET | /inventory | AI assets; POST /inventory/{type}/{id} sets the risk tier, license and the rest |
GET | /lineage?kind=&id= | What uses a knowledge base, file, data source, skill, model or tool |
GET | /departments | AI use per department |
GET | /models/history | Model and connection changes |
GET | /evidence?since=&until= | The evidence pack (ZIP); X-Content-SHA256 is its hash |
POST / GET | /shadow-ai/import, /shadow-ai/imports | Check a log (multipart: file, source, sanctioned); earlier imports |
GET | /archives | Archived agent run days |
Two-step sign-in is under /api/v1/auths/mfa: verify, status, setup, enable, disable, recovery-codes, and, for admins, DELETE /users/{user_id}.