# System Architecture

<figure><img src="/files/WT3vNSRyB8WlwBMkbhmZ" alt=""><figcaption></figcaption></figure>

#### 1. Input Layer

* **Users / AI Agents** send transactions either via **HTTP API** or **RPC**.
* Each transaction is submitted together with its **declared intent (reason)**.

#### 2. Gateway & Core

* **TxSentinel Gateways** receive transactions and forward them to the **Core**.
* The **Core** acts as the central hub, routing each transaction to different analysis modules.

#### 3. Sentinel Cluster

* A decentralized network of specialized Sentinels focused on different domains:
  * **DeFi risks**
  * **Smart contract vulnerabilities**
  * **Hack detection**
  * **Scam / phishing checks**
* The cluster analyzes the incoming transaction and sends back **warnings** when suspicious behavior is detected.

#### 4. AI Agent & Simulation Layer

* The **AI Agent (LLM-powered)** takes the transaction, the declared intent, the simulation output, and any warnings.
* It performs a **semantic evaluation**:
  * Does the transaction outcome match the intent (reason)?
  * Do warnings indicate hidden risks?
  * Does the simulation confirm safe execution?

#### 5. Decision Layer

* Based on the evaluation, the system decides whether the transaction should be **sent** or **blocked** (`send / not send`).
* All warnings, reasons, and simulations are logged for transparency and further analysis.


---

# Agent Instructions: 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:

```
GET https://txsentinel.gitbook.io/baibysitter/architecture/system-architecture.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
