Skip to main content

Data Flow

How data moves through the Intentra system.

Overview

┌─────────────┐     ┌─────────────┐     ┌─────────────┐     ┌─────────────┐
│   AI Tool   │ ──▶ │  CLI Hook   │ ──▶ │  Normalize  │ ──▶ │    Sync     │
│   (Cursor)  │     │   Handler   │     │   & Scan    │     │   to API    │
└─────────────┘     └─────────────┘     └─────────────┘     └─────────────┘

Event Lifecycle

1. Hook Trigger

AI tool completes an action and fires a hook event:

Cursor IDE                          Intentra CLI
    │                                    │
    │  afterFileEdit event               │
    │ ──────────────────────────────────▶│
    │                                    │
    │  (non-blocking, async)             │
    │◀────────────────────────────────── │
    │                                    │

The hook never blocks the IDE - events are captured asynchronously.

2. Event Normalization

Each tool sends events in different formats. The CLI normalizes them:

Tool-Specific Events              Normalized Event
─────────────────────────────────────────────────────
Cursor:  afterFileEdit      ──▶   after_file_edit
Claude:  PostToolUse        ──▶   after_tool
Copilot: completion         ──▶   after_response

3. Scan Creation

Events are grouped into scans by conversation ID:

Events (same conversation)         Scan
───────────────────────────────────────────
after_response (500 tokens)   ┐
after_file_edit               │──▶  Scan A
after_response (750 tokens)   │     1250 tokens
after_shell                   ┘     2 LLM calls

4. Server Sync

Scans are synced to your Intentra account:

CLI                              Intentra API
 │                                    │
 │  POST /v1/scans                    │
 │  Authorization: Bearer <jwt>       │
 │ ──────────────────────────────────▶│
 │                                    │
 │  200 OK                            │
 │◀────────────────────────────────── │
 │                                    │

Offline Operation

All data is processed locally first:

  • Works without internet connection
  • Scans queue during offline periods
  • Automatic sync when connection restored
Online:   Event ──▶ Scan ──▶ Sync ──▶ API
Offline:  Event ──▶ Scan ──▶ Queue ──▶ (wait) ──▶ Sync
Data Flow - Intentra Docs