Skip to content

Iris query patterns cookbook

This is the cookbook of canonical Iris queries — copy + paste, get an answer, learn the pattern. Organized by what you’re trying to accomplish, not by which underlying tool fires.

If you’re new to Iris, read Getting started first — this page assumes you understand the count/list/breakdown query shapes.

Operational queries (Sarah Chen, daily ops)

These run constantly during normal IAM operations.

“How many users are active right now?”

how many users are active

Returns: a count, from compose_metric (active users). The “Based on” footer names its source.

“Users who haven’t logged in for 90 days”

how many active users have not logged in for 90 days

Returns: a count of active users whose last login is older than 90 days or who never logged in. Dormant accounts are a classic review target.

“Break down active users by department”

break down active users by department

Returns: a group-by table. Users without a department appear as their own Unassigned bucket, not omitted.

“Pending access requests older than 14 days”

how many access requests have been pending for more than 14 days

Returns: a count (compose_metric, stale access requests). For the individual requests stuck at an approval stage, ask “which access requests are stuck in approval” — Iris lists them oldest first with the current approver.

“Connector sync health”

which connectors have sync errors

Returns: each connector’s sync health and last sync time (for Identity Admin and Super Admin). Operator’s morning triage — “what connectors broke overnight?”

“Open SoD violations right now”

show me open sod violations

Returns: the violations with rule name, user and risk level. For just the numbers by risk level, ask “how many SoD violations by risk level”.

Compliance queries (Priya Singh, CISO posture)

These run weekly/monthly for governance reporting.

“Certification campaign progress”

show me the progress of active certification campaigns

Returns: campaigns with total, completed, pending and overdue reviews and the reviewers holding them up.

“Rejected access requests in the last 30 days”

how many access requests were rejected in the last 30 days

Returns: a count for the window (compose_metric, rejected access requests). Weekly trend lines for access-request outcomes are not available yet; audit-event trends are (see below).

“Users with unusually broad access”

which users have access to more than 10 applications

Returns: users ranked by the number of applications they can reach, from the user-access view via iris_sql (for roles that hold it). The pattern of “scope creep” — users who accumulated access through moves without revocation.

“Agents by risk”

break down agents by risk band

Returns: agent counts by LOW / MEDIUM / HIGH / CRITICAL risk band (compose_metric, agents by risk band). CISO’s “what’s our agent identity surface” question. Non-human identities in the NHI registry can be broken down by environment (“break down NHIs by environment”).

“Audit events by action type, last 7 days”

break down audit events by action type for the last 7 days

Returns: action-type frequency distribution. Spot anomalies (e.g., an unusual RBAC_DENIED spike).

Agent management queries (Dev Torres, NHI ops)

These run during agent lifecycle work. The agent tools below are offered to agent_engineer and super_admin; counts through compose_metric are available to every role.

“Riskiest agents”

show me the highest risk agents

Returns: agents ordered by risk score, highest first.

“Pending agent registrations”

how many agents are pending review

Returns: the number of agents waiting for governance review. The morning queue for whoever owns agent approvals.

“Shadow agents”

show me unregistered agents

Returns: automated processes the discovery scanner has detected but nobody has registered yet. Candidates for registration or shutdown.

“Who can act for whom”

show me agent delegation chains

Returns: which agents hold delegated authority over other agents, and at what trust level. CISO’s “which agents can do dangerous things” question.

Audit forensics queries (Marcus Brooks, external auditor)

These run during SOC 2 fieldwork. See Set up an external auditor for SOC 2 evidence collection for the full engagement flow.

“Verify audit chain integrity”

verify audit chain integrity

Returns: INTACT, CHAIN_GAP or TAMPERED for the latest entries (up to 500), with the sequence range checked and the break point if any. It does not take a date range; see Iris for compliance officers for longer ranges. Auditor’s first-day check.

“Recent actions by user X”

show me the audit events by user@example.com

Returns: that person’s most recent audit records, newest first, up to 100. There is no date-range filter; for a complete 90-day history, export from the Audit Log page.

“Recent config changes”

show me recent audit events with action type POLICY_UPDATED

Returns: matching audit records (the action-type filter is a case-insensitive substring match), each with its recorded new state. SOC 2 CC8.1 evidence; the Audit Log page shows the full record.

“Denied actions in the last 30 days”

how many RBAC_DENIED events were there in the last 30 days

Returns: the count for that action type in the window (audit event volume by action type). SOC 2 CC7 anomaly-detection evidence.

“Cross-tenant query attempts (should be zero)”

show me IRIS_SQL_TENANT_LEAK events

Returns: ideally nothing. A non-zero result means the cross-tenant check on Iris’s view queries blocked a result — treat it as a P0 incident.

Iris-specific meta-queries

“What can you do?”

what can you do

Returns: a capability list. Onboarding-shaped response.

“Show me the query”

For an iris_sql answer, open the Query run disclosure under the answer to see the exact query that executed. For other tools, the “Based on” footer names the source tables, row count and time window.

When the cookbook doesn’t have what you need

Three escape hatches:

  1. Rephrase. Iris also matches on meaning, not just wording, so a different phrasing often reaches the right tool. Try "how many users have logged in this week" if "weekly active users count" doesn’t match.
  2. Ask for a view query. If your role holds iris_sql, describe what you want from one curated view — Iris builds a structured, read-only query and shows it under Query run. It does not run pasted SQL and cannot join views. See Iris tool catalog.
  3. File a feature request. If you ask the same question regularly and Iris can’t answer, email hello@atmanid.com — the catalog grows from observed gaps.

Adjacent reading

© AtmanID · Privacy