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

# 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.
