nano SIEM
Search Commands

ai

Have pivt classify each result row against your instruction, adding ai_verdict, ai_confidence and ai_reasoning columns.

Use ai to classify your result rows with pivt, nano's AI assistant. Narrow the rows first, then provide an instruction to add a verdict, confidence, and reasoning to each row.

Use it to triage a short list of top talkers, rare processes, or summarized logon failures.

ai is slow and metered compared with ordinary commands. Reduce the result with filters, stats or head first.

Syntax

... | ai prompt="<instruction>" [max_rows=<n>]
... | ai "<instruction>"
ArgumentDefaultDescription
prompt— (required)The instruction. Name the verdict labels you want back, so a later where ai_verdict=... matches. A bare quoted string is the same as prompt=.
max_rows100Rows sent to the model. Capped at 500.

Output

Every row gets:

ColumnTypeMeaning
ai_verdictstringThe label the model chose, from the ones your instruction implies (for example MALICIOUS, SUSPICIOUS, BENIGN)
ai_confidencenumber0.0 to 1.0
ai_reasoningstringA short explanation

Special verdicts:

  • SKIPPED: the row was past max_rows, or AI is not available on this deployment.
  • ERROR: the AI call failed or timed out. ai_reasoning carries the error.

Examples

Classify blocked proxy requests per source and destination:

metadata.log_source=conduit_proxy action_id=2 | stats count, sum(traffic.bytes_out) as sent by src_endpoint.ip, http_request.url.hostname | sort -count | head 50 | ai prompt="Classify each row as NORMAL, SUSPICIOUS or MALICIOUS. Look for data exfiltration, C2 beaconing and known-bad domains." | where ai_verdict!="NORMAL"

Triage users with many failed logons:

class_uid=3002 status_id=2 | stats count, dc(src_endpoint.ip) as sources by user.name | where count > 20 | ai "Label each row BRUTE_FORCE, SPRAY or BENIGN based on failure count and number of source IPs." | sort -ai_confidence

Review rare PowerShell command lines:

class_uid=1007 process.name="powershell.exe" | rare limit=25 process.cmd_line | ai prompt="Is this command line likely malicious? Answer MALICIOUS or BENIGN." max_rows=25 | table process.cmd_line, ai_verdict, ai_confidence, ai_reasoning

Availability

Run commands after enrichment

ai runs after ClickHouse returns rows. The search splits at the first lookup, prevalence, inputlookup, resolve_identity, ai or lateral stage, and every command after it runs in post-processing. Only these commands work there: where, head, tail, sort, table, stats, dedup, rename, fields, top, rare, fillnull, eval, timechart, rex, risk, reverse, tree.

ai inside a subsearch (append, join, IN [ ... ]) is refused.

What's next

  • stats: summarize before classifying
  • rare: pick the unusual values to classify
  • where: filter on ai_verdict and ai_confidence

On this page