> For the complete documentation index, see [llms.txt](https://wakehacker.gitbook.io/wakehacker/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://wakehacker.gitbook.io/wakehacker/autonomous-auditing/ai-intelligence.md).

# AI Intelligence

The open-source Wake Framework is extended with **private detectors** that enhance its analysis capabilities. These detectors combine Wake's **precise static analysis** with **AI** to enable further detection of complex vulnerability patterns and reduce false positives.

## Better Result Interpretation

The AI layer augments Wake's detection capabilities by leveraging **comprehensive knowledge** of both the framework's documentation and the analyzed codebase. This understanding enables **additional interpretation** of findings, providing audience with contextual analysis of the discovered issues.

## Example: AI-enhanced keccak Detector

AI detectors that extend the Wake Framework are kept private, but we demonstrate on one example the **direction and possibilities** of AI in static analysis.

The keccak256 private AI Wake detector validates storage slot computations where developers document their hash calculations in code comments. While these comments vary in format, LLMs can interpret them and verify the implementation.

For example, when encountering code like:

```solidity
// slot = keccak256(abi.encode(POSITION_MANAGER_STORAGE_POSITION))
bytes32 private constant POSITION_MANAGER_STORAGE_SLOT = 0x9994c8b75655dd4c31c9655065b829358f4b10699505a627bacfb3faa3f9e2d2;
```

The detector:

1. Extracts the computation description from comments
2. Understands the intended calculation
3. Performs the actual keccak256 computation
4. Compares with the implemented constant
5. Flags any mismatches for review

This validation is particularly important for storage slot management and proxy implementations where incorrect hash values could lead to storage collisions. It demonstrates the new AI possibilities in static analysis. This approach was presented at [ETH Prague 2024](https://www.youtube.com/watch?v=p4hn9waDtwM).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://wakehacker.gitbook.io/wakehacker/autonomous-auditing/ai-intelligence.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
