# Give security agents the full event history

> Run security analytics for agentic SOC and SIEM workflows. Detect event sequences with SQL and give agents governed access to the underlying evidence.

Bring security events, identity, and infrastructure context into the same SQL layer. Build **agentic SOC** and **SIEM workflows** that can trace a suspicious sequence back to the events behind it.

[Start for free](/sign-up)[Read the docs](/docs/lakehouse/features/match-recognize.md)

Security analytics

## Investigate beyond the alert

Keep security event history queryable in the lakehouse. Correlate activity across time, join it with live operational context, and let analysts and agents investigate the same evidence alongside your existing SIEM.

![Investigate beyond the alert](/assets/illus/product/security-overview.png)

![Detect sequences in SQL](/assets/illus/product/icons/security-sequences.png)

##### Detect sequences in SQL

Find ordered security event sequences, bounded by time and partitioned by the subject under investigation, with [MATCH\_RECOGNIZE](/docs/lakehouse/features/match-recognize.md). Define the steps, partition keys, and time limit in the query.

![Group activity into sessions](/assets/illus/product/icons/security-sessions.png)

##### Group activity into sessions

Use [SESSIONIZE](/docs/lakehouse/features/sessionize.md) to group events by identity or host and split activity after an inactivity gap. Keep each event or return a summary of each burst.

![Connect the evidence to its owner](/assets/illus/product/icons/security-owner.png)

##### Connect the evidence to its owner

Join security events with identity records, asset owners, and operational data through federated SQL. Give investigators the account and infrastructure context behind a match.

![Give agents governed access](/assets/illus/product/icons/security-agent-access.png)

##### Give agents governed access

Let SOC agents query event history and follow up on suspicious sequences through [MCP](/docs/agents/mcp.md). Scope access to the data they need and share the definitions that make results interpretable.

## From event history to investigation context

Keep the full sequence visible, correlate it with the systems and people behind it, and give agents a grounded starting point.

01

Preserve the sequence

Keep events ordered by subject and time, with the full history available for review.

02

Find the shape

Use session gaps and ordered patterns to surface activity worth investigating.

03

Ground the next step

Join identity, asset, and operational context before an agent acts on a finding.

security-sequence.sql · 320,200 rows · 0.5s

```
WITH sessions AS (
    SELECT * FROM security_events
    SESSIONIZE (
        PARTITION BY subject_id
        ORDER BY occurred_at, event_id
        GAP INTERVAL 30 MINUTE
    )
)
SELECT * FROM sessions
MATCH_RECOGNIZE (
    PARTITION BY subject_id, session_id
    ORDER BY occurred_at, event_id
    MEASURES
        FIRST(A.occurred_at) AS sequence_start,
        C.occurred_at AS sequence_end,
        COUNT(A.*) AS failed_attempts
    ONE ROW PER MATCH
    PATTERN (A{3,} B C) WITHIN INTERVAL 15 MINUTE
    DEFINE
        A AS event_type = 'login_failed',
        B AS event_type = 'login_succeed',
        C AS event_type = 'changed_password'
)
ORDER BY subject_id, session_id, sequence_start;
```

This example uses a `security_events` table with `subject_id`, `occurred_at`, `event_id`, and `event_type` columns. A gap longer than 30 minutes starts a new session. The pattern finds three or more failed logins, a successful login, and a password change within 15 minutes.

SQL reference: [MATCH\_RECOGNIZE](/docs/lakehouse/features/match-recognize.md) · [SESSIONIZE](/docs/lakehouse/features/sessionize.md)

Engineering: [Row pattern benchmarks](/blog/2026-08-07-match-recognize-that-scales.md) · [Session window benchmarks](/blog/2026-09-01-session-windows-in-duckdb.md)

## Explore the rest of the platform

More workloads on the same engine, governance, and pricing.

[![Lakehouse](/assets/illus/product/duckdb-lakehouse-schematic.png)](/product/lakehouse.md)

#### [Lakehouse](/product/lakehouse.md)

[Query live data across systems with DuckDB-powered execution, open storage, and predictable economics. Build on one context lakehouse instead of another warehouse-centered stack.](/product/lakehouse.md)

[![Cousteau](/assets/illus/product/explore-cousteau.png)](/product/cousteau.md)

#### [Cousteau](/product/cousteau.md)

[Investigate product changes across events, logs, customer data, and code. Cousteau brings back what changed, why, and who is affected.](/product/cousteau.md)

[![Self-serve BI](/assets/illus/product/explore-self-serve-bi.png)](/product/self-serve-bi.md)

#### [Self-serve BI](/product/self-serve-bi.md)

[Give every team live dashboards, shared metrics, and agent-assisted exploration on the same governed data foundation.](/product/self-serve-bi.md)

## Build security investigations on the full history

DuckDB workers on open formats, federated SQL across your existing systems,\
and an MCP server for agents — at flat monthly pricing.

[Start 14-day free trial](/sign-up)

[Read the docs](/docs/lakehouse/features/match-recognize.md)

[Web version](https://altertable.ai/product/security-lakehouse)
