# aranaisec-cyber/aran architecture

> Architecture diagram of the GitHub repository aranaisec-cyber/aran, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-12-03). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/aranaisec-cyber/aran
- Repository: https://github.com/aranaisec-cyber/aran

## Overview

Aran is a local stdio proxy placed between an IDE/agent and an MCP server. Its main workflow checks outbound tool calls, forwards permitted traffic, scans inbound results, and records gate decisions in a local audit log. Optional capabilities include GitHub repository scanning, repeat-call detection, personal allowlists, human approvals, and status/explanation tools. The README documents the main flow and feature set; source excerpts show several supporting components, but the proxy implementation is only partially sampled, so uncertain call relationships are omitted or marked unverified.

Main entry points: [`src/aran/proxy.py`](https://github.com/aranaisec-cyber/aran/blob/main/src/aran/proxy.py) (MCP stdio proxy), [`src/aran/gates.py`](https://github.com/aranaisec-cyber/aran/blob/main/src/aran/gates.py) (Outbound gate), [`src/aran/approvals.py`](https://github.com/aranaisec-cyber/aran/blob/main/src/aran/approvals.py) (Approval store), [`src/aran/audit.py`](https://github.com/aranaisec-cyber/aran/blob/main/src/aran/audit.py) (JSONL audit log)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_proxy_flow["Proxy and gates"]
  node_cli["Aran CLI<br/>[cli.py]"]
  node_proxy["MCP stdio proxy<br/>[proxy.py]"]
  node_outbound_gate["Outbound gate<br/>[gates.py]"]
  node_inbound_gate["Inbound gate<br/>[gates.py]"]
end

subgraph group_policies["Rules and checks"]
  node_rules["Signature rules<br/>[rules.py]"]
  node_allowlist["Personal allowlist<br/>[allowlist.py]"]
  node_repo_scan["GitHub repo scan<br/>[repo_scan.py]"]
  node_loop_guard["Repeat-call guard<br/>[loop_guard.py]"]
end

subgraph group_approvals["Human approvals"]
  node_approval_store[("Approval store<br/>[approvals.py]")]
  node_approval_cli["Approval commands<br/>[approvals_cli.py]"]
  node_approval_dialog["Desktop approval dialog<br/>[approval_dialog.py]"]
end

subgraph group_observability["Audit and status"]
  node_audit[("JSONL audit log<br/>[audit.py]")]
  node_status["Status / explain tools<br/>[status.py]"]
end

node_ide(("IDE / agent"))
node_mcp_server["Real MCP server"]
node_github["GitHub"]
node_developer(("Developer"))

node_ide -->|"launches"| node_cli
node_cli -->|"starts"| node_proxy
node_ide -->|"sends calls"| node_proxy
node_proxy -->|"checks calls"| node_outbound_gate
node_outbound_gate -->|"forwards clean"| node_mcp_server
node_outbound_gate -.->|"returns blocked"| node_ide
node_mcp_server -->|"returns results"| node_proxy
node_proxy -->|"checks results"| node_inbound_gate
node_inbound_gate -->|"relays or redacts"| node_ide
node_outbound_gate -.->|"matches signatures"| node_rules
node_inbound_gate -.->|"matches signatures"| node_rules
node_proxy -.->|"loads overrides"| node_allowlist
node_proxy -.->|"may scan repos"| node_repo_scan
node_repo_scan -.->|"fetches repository"| node_github
node_proxy -.->|"may check repeats"| node_loop_guard
node_proxy -.->|"may request approval"| node_approval_store
node_developer -->|"reviews calls"| node_approval_cli
node_developer -.->|"decides request"| node_approval_dialog
node_approval_cli -->|"reads and updates"| node_approval_store
node_approval_dialog -.->|"records decision"| node_approval_store
node_outbound_gate -->|"records decisions"| node_audit
node_inbound_gate -->|"records decisions"| node_audit
node_status -->|"reads events"| node_audit
node_proxy -.->|"exposes tools"| node_status

click node_cli "https://github.com/aranaisec-cyber/aran/blob/main/src/aran/cli.py"
click node_proxy "https://github.com/aranaisec-cyber/aran/blob/main/src/aran/proxy.py"
click node_outbound_gate "https://github.com/aranaisec-cyber/aran/blob/main/src/aran/gates.py"
click node_inbound_gate "https://github.com/aranaisec-cyber/aran/blob/main/src/aran/gates.py"
click node_rules "https://github.com/aranaisec-cyber/aran/blob/main/src/aran/rules.py"
click node_allowlist "https://github.com/aranaisec-cyber/aran/blob/main/src/aran/allowlist.py"
click node_repo_scan "https://github.com/aranaisec-cyber/aran/blob/main/src/aran/repo_scan.py"
click node_loop_guard "https://github.com/aranaisec-cyber/aran/blob/main/src/aran/loop_guard.py"
click node_approval_store "https://github.com/aranaisec-cyber/aran/blob/main/src/aran/approvals.py"
click node_approval_cli "https://github.com/aranaisec-cyber/aran/blob/main/src/aran/approvals_cli.py"
click node_approval_dialog "https://github.com/aranaisec-cyber/aran/blob/main/src/aran/approval_dialog.py"
click node_audit "https://github.com/aranaisec-cyber/aran/blob/main/src/aran/audit.py"
click node_status "https://github.com/aranaisec-cyber/aran/blob/main/src/aran/status.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_cli,node_proxy,node_outbound_gate,node_inbound_gate toneBlue
class node_rules,node_allowlist,node_repo_scan,node_loop_guard toneAmber
class node_approval_store,node_approval_cli,node_approval_dialog,node_mcp_server toneMint
class node_audit,node_status toneRose
class node_ide,node_github,node_developer toneIndigo
```

## Components

### Proxy and gates

- [Aran CLI](https://github.com/aranaisec-cyber/aran/blob/main/src/aran/cli.py): `src/aran/cli.py`
- [MCP stdio proxy](https://github.com/aranaisec-cyber/aran/blob/main/src/aran/proxy.py): `src/aran/proxy.py`
- [Outbound gate](https://github.com/aranaisec-cyber/aran/blob/main/src/aran/gates.py): `src/aran/gates.py`
- [Inbound gate](https://github.com/aranaisec-cyber/aran/blob/main/src/aran/gates.py): `src/aran/gates.py`

### Rules and checks

- [Signature rules](https://github.com/aranaisec-cyber/aran/blob/main/src/aran/rules.py): `src/aran/rules.py`
- [Personal allowlist](https://github.com/aranaisec-cyber/aran/blob/main/src/aran/allowlist.py): `src/aran/allowlist.py`
- [GitHub repo scan](https://github.com/aranaisec-cyber/aran/blob/main/src/aran/repo_scan.py): `src/aran/repo_scan.py`
- [Repeat-call guard](https://github.com/aranaisec-cyber/aran/blob/main/src/aran/loop_guard.py): `src/aran/loop_guard.py`

### Human approvals

- [Approval store](https://github.com/aranaisec-cyber/aran/blob/main/src/aran/approvals.py): `src/aran/approvals.py`
- [Approval commands](https://github.com/aranaisec-cyber/aran/blob/main/src/aran/approvals_cli.py): `src/aran/approvals_cli.py`
- [Desktop approval dialog](https://github.com/aranaisec-cyber/aran/blob/main/src/aran/approval_dialog.py): `src/aran/approval_dialog.py`

### Audit and status

- [JSONL audit log](https://github.com/aranaisec-cyber/aran/blob/main/src/aran/audit.py): `src/aran/audit.py`
- [Status / explain tools](https://github.com/aranaisec-cyber/aran/blob/main/src/aran/status.py): `src/aran/status.py`

### Other components

- **IDE / agent**
- **Real MCP server**
- **GitHub**
- **Developer**

## Connections

- IDE / agent → Aran CLI: launches (evidence: `README.md`)
- Aran CLI → MCP stdio proxy: starts (evidence: `README.md`)
- IDE / agent → MCP stdio proxy: sends calls (evidence: `README.md`)
- MCP stdio proxy → Outbound gate: checks calls (evidence: `README.md`)
- Outbound gate → Real MCP server: forwards clean (evidence: `README.md`)
- Outbound gate → IDE / agent: returns blocked (evidence: `README.md`)
- Real MCP server → MCP stdio proxy: returns results (evidence: `README.md`)
- MCP stdio proxy → Inbound gate: checks results (evidence: `README.md`)
- Inbound gate → IDE / agent: relays or redacts (evidence: `README.md`)
- Outbound gate → Signature rules: matches signatures
- Inbound gate → Signature rules: matches signatures
- MCP stdio proxy → Personal allowlist: loads overrides (evidence: `src/aran/proxy.py`)
- MCP stdio proxy → GitHub repo scan: may scan repos (evidence: `README.md`)
- GitHub repo scan → GitHub: fetches repository (evidence: `src/aran/repo_scan.py`)
- MCP stdio proxy → Repeat-call guard: may check repeats (evidence: `README.md`)
- MCP stdio proxy → Approval store: may request approval (evidence: `README.md`)
- Developer → Approval commands: reviews calls (evidence: `src/aran/approvals_cli.py`)
- Developer → Desktop approval dialog: decides request (evidence: `src/aran/approval_dialog.py`)
- Approval commands → Approval store: reads and updates (evidence: `src/aran/approvals_cli.py`)
- Desktop approval dialog → Approval store: records decision (evidence: `src/aran/approval_dialog.py`)
- Outbound gate → JSONL audit log: records decisions (evidence: `README.md`)
- Inbound gate → JSONL audit log: records decisions (evidence: `README.md`)
- Status / explain tools → JSONL audit log: reads events (evidence: `src/aran/status.py`)
- MCP stdio proxy → Status / explain tools: exposes tools (evidence: `src/aran/proxy.py`)
