# AI-assisted investigation

TKTail gives an AI agent structured, bounded investigation capabilities instead of forcing it to improvise with raw files, shell commands and one-off scripts. The agent asks; TKTail searches, parses, counts and correlates where the records are, keeps the proof, and answers with the result - each answer naming the TKTail that produced it.

You can build these investigations yourself - with PowerShell, Python or C#. TKTail gives you a tested, reusable, bounded implementation already: fewer one-off scripts, more reusable investigation.

1. **Connect** - an AI client to a controlled investigation interface
2. **Teach** - TKTail your log format, if it does not know it yet
3. **Search and aggregate** - locally - only the answer travels to the model
4. **Correlate** - logs, Windows events and Metrics on one time scale
5. **Preserve** - the records that prove it, redacted and hashed
6. **Record** - the conclusion with the evidence for the next shift
7. **Reuse** - formats, pinned searches and evidence in the next investigation

## Works with your logs, not only built-in formats

Will an AI understand your application's logs? TKTail reads 35+ formats as fields out of the box - IIS, JSON lines, CSV, syslog, Apache / nginx and more. For your own format, the agent drafts a custom format from a sample of records, previews it on real records - each one a match, a partial match or no match - and saves it as a profile when you allow it. From then on TKTail parses every record itself; no model reads your log line by line.

**Teach TKTail the format once. Let every later search, alert, evidence package and AI session work with structured fields.**

1. **Sample** - a bounded sample of records - not the whole log
2. **Draft** - a format from a template: line, multi-line, delimited, application log
3. **Preview** - on real records: which match, which fields, which types
4. **Save** - a reusable profile - only with your switch on
5. **Use the fields** - in searches, summaries, alerts and evidence
6. **Reuse** - next week, in a new session: no format work again

```
2026-11-08 12:32:11.391|ACCOUNT=ACC-1042|ORDER=ORD-AB1234|STATUS=PENDING|ELAPSED=1350|NOTE=risk check
```

| In the line | Field |
|---|---|
| `2026-11-08 12:32:11.391` | timestamp |
| `ACC-1042` | account |
| `ORD-AB1234` | order |
| `PENDING` | status |
| `1350` | elapsed (ms) |

Questions: "Which accounts have the most pending orders?" · "Show orders with elapsed over 1000 ms." · "Average elapsed per account?"

Saving a format needs Allow AI to save custom formats (off by default). Making it the permanent choice for a file or folder, and deleting a format, stay with you in Custom Format Studio. Shared meanings across formats (semantic profiles) and a record-size summary are planned - not in the current release. A format never widens what the agent may read.

[Teach TKTail your log format - the tutorial](https://tktail.dev/help/ai-assistance/#working-with-your-own-log-formats) · [Custom Format Studio](https://tktail.dev/help/custom-formats/)

## What an agent can do through TKTail

The connection is the Model Context Protocol (MCP) - the plumbing. What matters is what the agent can do through it:

- **Search**: text, regular expressions, fields and time ranges across open logs, folders and event logs - bounded result pages
- **Structured records**: the whole logical record parsed by its format - fields, severity, time - not a line of text
- **Aggregation**: group by, top N, time histograms and number summaries computed inside TKTail, over every match
- **Correlation**: ordered sequences across sources within time windows, joined by keys
- **Metrics**: Windows Performance Counters of the Metric Sets you collect - current values, history, summaries
- **Windows Event Log**: channels and saved .evtx files, searched like logs
- **Alerts**: conditions on logs and counters - an agent saves one only with your consent and can check that it is alive
- **Incidents**: what an alert captured - the trigger and its evidence - readable after the logs rotated
- **Incident management** (planned - not in the current release): acknowledge with a note, baselines, maintenance windows, annotations through MCP
- **Evidence**: the records that matter, redacted and hashed, kept after the source rotates or is deleted
- **Provenance**: every answer names the TKTail and the run that produced it
- **Permissions**: off until you enable it; every kind of write behind its own switch

## Do the work where the records are

Instead of sending thousands of records to a model, TKTail searches, filters, extracts, groups, aggregates, builds histograms, projects and counts next to the data - and sends only the useful result.

Historical benchmark — TKTail 1.1.0 - measured: "Which 10 clients sent the most POST requests answered 503?" over iis-100mb (1,365 matches), TKTail 1.1.0, suite competitive-bench-v1. Measured on TKTail 1.1.0 (commit aa57462840, Release - Shipping PGO fc87e24fd604) on 2026-11-06. Superseded by competitive-bench-v2 (Historical benchmark — TKTail 1.3.0-rc.1). The current release is TKTail 1.2.1; the release candidate in testing is TKTail 1.3.0-rc.6.

| Workflow | Sent to the AI (MCP answers) | MCP calls | External script | Time |
|---|---|---|---|---|
| Full records - every record read whole, counted by a script | 3.55 MB | 1,380 | yes | 16.1 s |
| Projection - only the needed field, counted by a script | 559.3 KB | 15 | yes | 3.19 s |
| TKTail aggregation - grouped and counted in TKTail, top 10 | 4.4 KB | 1 | no | 1.14 s |

The aggregation answer is 805x smaller than full records and 127x smaller than projected pages; the count alone is 965 B. Bytes and calls as measured - not tokens, not cost.

Raw speed is another question: in the benchmark's 8 cold scenarios the fastest was C# (.NET 10) (8). The benchmark shows every result, losses included.

- [The reproducible AI / scripting benchmark](https://tktail.dev/performance/competitive/#cmp-payload)
- [Benchmark source code](https://tktail.dev/releases/1.1.0/TKTail-Competitive-Benchmarks-competitive-bench-v1.zip) (TKTail-Competitive-Benchmarks-competitive-bench-v1.zip)
- [Raw results](https://tktail.dev/releases/1.1.0/TKTail-Competitive-Benchmark-Results-competitive-bench-v1.zip) (TKTail-Competitive-Benchmark-Results-competitive-bench-v1.zip)
- [Methodology](https://tktail.dev/performance/competitive/#methodology)

## For Operations: From an incident to a verified fix

Administrators, DevOps engineers, SREs and support: an assistant investigates what happened on the machine where it happened.

INCIDENT -> SEARCH -> CORRELATE -> PRESERVE EVIDENCE -> RECORD ROOT CAUSE -> VERIFY THE FIX

- **Incident**: an alert fired, or someone reports a symptom
- **Search**: the logs and event logs you opened or approved
- **Correlate**: the same minutes across logs, the Event Log and Metrics
- **Preserve evidence**: the records that explain it, redacted, before the logs rotate
- **Record root cause**: the conclusion in the evidence package's note - the next shift reads it
- **Verify the fix**: the same search after the change - the counts compared

Today the conclusion lives in the evidence package and its note. Incident annotations, baselines and maintenance windows through MCP are planned - not in the current release.

[Investigate a production incident](https://tktail.dev/help/ai-production-incident/)

## For Developers: Runtime facts for a coding agent

TKTail is the runtime-observation layer. It does not edit source code - a coding agent such as Claude Code works with the code; TKTail tells it what the program actually did.

CODE -> BUILD / RUN -> TKTAIL -> LOGS + EVENTS + METRICS -> CODING AGENT -> NEXT CHANGE

- **Code**: the agent changes the code
- **Build / run**: the program runs and writes its logs
- **TKTail**: follows the growing log, its events and counters
- **Logs + events + metrics**: errors, slow operations, warnings - counted and compared
- **Coding agent**: reads the facts, not a wall of text
- **Next change**: and the next run shows whether it helped

The same questions after every build: did the error go, did the slow operation get faster, which warning is new.

[Develop with a coding agent](https://tktail.dev/help/ai-developer-loop/)

## More than a search result

- **Found**: the agent finds the records that explain the problem
- **Preserved**: TKTail keeps those records and their context - not a copy of the whole log
- **Redacted**: tokens, passwords, connection strings and keys removed before anything is written
- **Recorded**: where every byte came from, and a SHA-256 for every file
- **Kept**: still verifiable after the source log rotated or was deleted

Measured on a 1.0 GB synthetic trace: 57 results with 20 records on each side became a 142 KB package in 0.35 s. TKTail read 47 MB of the file (4.7 %) - never all of it.

[Saving evidence](https://tktail.dev/help/saving-evidence/)

## Controlled access for AI

Give the agent the investigation capability it needs - not the machine-level capability it does not.

1. **Windows account** - the operating system's security - always underneath; TKTail never replaces it
2. **Connection** - stdio on this PC, or HTTP with a token
3. **AI access switch** - off until you turn it on
4. **Scope** - what is open + folders you approved
5. **Per-change switches** - formats, searches, alerts, evidence - each off by default
6. **Confirmation** - deleting evidence needs you
7. **Bounds** - answer sizes, pages, stored results, waits, regex limits, quotas

- **Off until you enable it**: AI access is a setting; nothing answers before you turn it on, and turning it off refuses the next call.
- **Your scope, not the account's**: An agent reads what you opened in TKTail and, with Trial / Pro, the folders you approved as Investigation Roots - not everything the Windows account can read. Only you add folders.
- **Read, change and delete apart**: Alerts, Saved Searches, Metric Sets, custom formats and evidence - each kind of change a separate switch, off by default.
- **People decide what is consequential**: Deleting evidence is a request; you confirm or reject it in TKTail. Incidents and folder approvals are not available to agents at all.
- **No code execution**: TKTail runs no shell, script or program for an agent: it offers named operations with defined answers and bounds.
- **Content is data**: A log line that tells an AI to read a secret changes nothing in TKTail: permissions come from your settings and license only.
- **Provenance**: Every answer names the TKTail node and run that produced it; evidence names each source's identity and byte ranges, with SHA-256 hashes.
- **Redaction, exactly**: Evidence packages and pinned search snapshots are redacted before they are written. Ordinary reads of a log return its text as stored - secrets included: AI access means reading what is open in TKTail.

| Dimension | TKTail | PowerShell, Python and C# benchmark helpers |
|---|---|---|
| Purpose-specific operations | built-in - search, aggregate, records, metrics, events, evidence | not in the helper - the helper is code; the agent writes or runs code |
| Arbitrary code execution needed | n/a - no - for the supported operations | not in the helper - yes - the diagnostic itself is a program |
| Filesystem scope narrower than the account | built-in - open sources + approved folders | not in the helper - whatever the account can read |
| Separate read / change / delete permissions | built-in - one switch per kind of change | not in the helper |
| Confirmation of destructive actions | partial - evidence deletion; alert / search deletion: switch only | not in the helper |
| Resource bounds | built-in - fixed caps; an operation budget is planned | not in the helper |
| Secret redaction | partial - evidence and pinned snapshots; normal reads are raw | not in the helper |
| Evidence with provenance and hashes | built-in - source identity, byte ranges, SHA-256, verification | not in the helper - prints an answer |
| Actor audit | partial - a log line per AI call and change; no client identity yet | not in the helper |
| Cancellation | built-in - an agent cancels its own searches | not in the helper - end the process |
| Durable investigation context | built-in - pinned searches, evidence, formats, incidents | not in the helper |
| Installation and runtime | built-in - one TKTail.exe, deployed once | n/a - Windows PowerShell 5.1 is part of Windows; Python, PowerShell 7 or the .NET runtime may need installing (a C# helper can also be self-contained or NativeAOT, a Python helper frozen); the helper must be written and deployed |

Helpers: the PowerShell, Python and C# programs of the reproducible benchmark - competent, purpose-built code that answers each question. They can be extended to do more; this compares what the tested programs do, not what the languages can do.

TKTail governs TKTail's tools - not other tools the AI client has (a shell, file access), not what the client sends to its model provider, and not the rights of the Windows account. Not yet available: naming which AI client acted, a separate approval of each consequential operation, time-limited permissions, an append-only audit log. On a developer machine a coding agent usually has a shell already - TKTail then adds a stable, structured way to read what the program did, not a sandbox.

[Permissions and access model](https://tktail.dev/help/ai-assistance/#permissions-and-access-model)

## You can build these capabilities yourself

| Capability | TKTail | Benchmark helper |
|---|---|---|
| Large-file search | yes | yes - for the question it was written for |
| Structured formats (35+ built in) | yes | no - one layout, in the code |
| Your own formats (Custom Format Studio, reusable profiles) | yes | no |
| Aggregation (group, top N, histogram, numbers) | yes | one fixed summary per program |
| Metrics (Performance Counters) | yes - Trial / Pro | no |
| Durable Metrics history | planned | no |
| Windows Event Log | yes | no |
| Rotating file series | yes | no |
| Compressed history (.gz) | planned | no |
| Alerts | yes | no |
| Evidence packages: redaction, provenance, hashes, verification | yes | no |
| Incident management (notes, baselines, maintenance) | planned | no |
| Saved and pinned searches | yes | no |
| Access control for AI clients | yes | no |
| MCP interface for AI clients | yes | no |
| Offline Help and an AI guide | yes | no |

Every capability with its release and each tested helper's state, read from the helpers' source: [From a production symptom to durable evidence](https://tktail.dev/ai/investigation-workflow/#matrix)

Evidence a custom helper would have to implement:

- the selected records and their context (by records and by seconds)
- several sources in one package (logs, event logs, Metric Sets)
- each source's identity (file identity, not only its name) and exact byte ranges
- the format the records were read with and their parsed fields
- secret redaction with built-in and your own rules, before anything is written
- a SHA-256 for every file and for the archive, and a manifest
- verification: VALID, MODIFIED, INCOMPLETE
- atomic finalization, cancellation and visible failure states
- size quotas and free-disk protection
- a library: list, look up, share a copy, delete with confirmation
- permissions for AI clients and an MCP contract
- everything kept across restarts and after the source rotated

## No diagnostic runtime stack required

An AI agent that investigates through TKTail starts with investigation tools - not by assembling a scripting environment on the machine being diagnosed.

Through TKTail:

1. **An approved native executable** - one portable package, Windows system DLLs only, no additional runtime
2. **Controlled MCP** - off until you allow it; what is open plus the folders you approve
3. **Structured investigation** - search, aggregate, correlate, preserve - named operations with bounded answers

With a helper written for the question:

1. **Runtime discovery** - which language runtimes and versions the machine has
2. **Helper creation** - a parser, a filter and a counter, written for this question
3. **Dependency management** - a runtime, packages or a build to bring, approve and keep current
4. **Validation** - is the output right, complete and safe to keep?

One package (README.txt, THIRD_PARTY_NOTICES.txt, TKTail.exe, help/); TKTail.exe is native x64 code with the C runtime linked in statically and imports only Windows system DLLs - no .NET.
Windows: Windows 10 version 1607 or later, Windows 11, or Windows Server 2016 or later - x64.

Normal local investigation needs no .NET runtime, no Python, no PowerShell 7, no external database, no log server and no agent service: no additional runtime dependencies.

A runtime is not always missing: Windows PowerShell 5.1 ships with Windows, a C# helper can be published self-contained or as NativeAOT, a Python helper can be frozen into one executable. The larger difference is a one-off helper against prebuilt investigation capabilities that are documented and tested with every release.

For operators: portable - extract and run, no installer and no administrator rights for normal use; no external backend, database or agent service for normal workstation use.

[Deployment and the machine being diagnosed](https://tktail.dev/ai/investigation-workflow/#deployment) · [System requirements](https://tktail.dev/help/system-requirements/)

## AI clients

- Claude Code - tested: real Claude Code sessions against the shipping build are part of the release acceptance (for TKTail 1.2.0: Claude Code 2.1.302 with the model claude-opus-5-5).
- Other MCP-compatible AI clients - protocol-compatible (standard MCP over stdio; Streamable HTTP with Trial or Pro), not tested by us.

## Shaped by real production investigations

- Answers too large to send to a model - aggregation, projection and count-only answers
- Evidence lost when a log rotated - evidence packages, kept after the source is gone
- A search repeated because it was closed - pinned searches, kept across restarts
- A few records that matter in a huge log - evidence of exactly those records and their context

## Preview - TKTail 1.3.0-rc.6 (Release Candidate)

*Release candidate - for testing, not the recommended release.*

### AI access in TKTail 1.3.0-rc.6

- AI access rules - exactly the files, folders and event logs you allow; default deny, an exclusion always wins: every edition (TKTail 1.2.1: Trial / Pro, as Investigation Roots).
- Secrets masked in everything TKTail sends to an assistant - passwords, tokens, keys and your own rules (AI Data Protection); your files and TKTail's own searches keep the real data.
- AI Investigation Activity: each call an assistant made, the decision about it and its scope, per client session - with its report; the AI Access Report says what an assistant could reach right now.
- Forensic Mode: TKTail performs no intentional persistent application writes to the investigated environment while strict Forensic Mode is active.
- Why an alert fired: the evaluation trace of every incident - each condition, whether it held and contributed, the counter samples it was decided on.

In TKTail 1.2.1, the current Stable release, an assistant reads the sources open in TKTail and the folders approved as Investigation Roots (Trial / Pro), and ordinary reads return records as stored - the controls above describe that release.

- [Security & trust (Preview)](https://tktail.dev/trust/) ([Markdown](https://tktail.dev/trust/index.md))

The release candidate TKTail 1.3.0-rc.6 reads 17 archive and compression formats - each one searched, aggregated, kept as evidence and open to AI clients over MCP, where it lies; 2 more are named and not read.

TKTail 1.2.1, the current Stable release, does not read archives or compressed logs: every format here was qualified in a release candidate - 1.3.0-rc.1 or later.

- [Archive and compressed log formats - the Preview's compatibility matrix](https://tktail.dev/preview/archive-formats/) ([JSON](https://tktail.dev/ai/archive-formats.json))

### Its own documentation for AI agents, inside TKTail.exe

The release candidate TKTail 1.3.0-rc.6 carries its own documentation for AI agents, compiled into the executable: version-matched to that exact build, available offline, read one small topic at a time - nothing to download, nothing injected into a session.

- **Topics**: 503
- **Size**: 327 KB compressed (845 KB of text)
- **Bound to**: TKTail 1.3.0-rc.6, commit 98535203bc - pack format 1, document schema 1

How an agent reads it: the MCP tools `tktail_list_knowledge` and `tktail_get_knowledge`; the command line `tktail knowledge list | get | export | verify`.

| Topics by category | Count |
|---|---|
| start | 1 |
| concepts | 8 |
| workflows | 2 |
| permissions | 3 |
| limits | 1 |
| help | 420 |
| product | 1 |
| tools | 64 |
| compatibility | 1 |
| licensing | 1 |
| errors | 1 |

The current Stable release, TKTail 1.2.1, is documented by this site's Help and its own AI Agent Harness.

- [Download the release candidate](https://tktail.dev/download/#release-candidate)

## More

- [From a production symptom to durable evidence](https://tktail.dev/ai/investigation-workflow/): the investigation workflow - TKTail beside purpose-built C#, Python and PowerShell helpers
- [AI assistance (Help)](https://tktail.dev/help/ai-assistance/)
- [AI integration - MCP (Help)](https://tktail.dev/help/mcp/)
- [MCP tool reference](https://tktail.dev/help/mcp-tools/)

---

The HTML page: https://tktail.dev/ai/
