# tariqdreamstech/ranbval-sdk architecture

> Architecture diagram of the GitHub repository tariqdreamstech/ranbval-sdk, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-17). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/tariqdreamstech/ranbval-sdk
- Repository: https://github.com/tariqdreamstech/ranbval-sdk

## Overview

Ranbval SDK loads encrypted and public configuration, resolves and decrypts secrets at runtime, and returns guarded values to applications. Its security path can enforce a repository allowlist; access is audited and reported to the Live Monitor. Separate capabilities include server-side secret proxying, remote environment and plan operations, and CLI setup, checking, and execution. Relationships below are limited to README statements and SOURCE INDEX references or excerpts; several implementations are unsampled, so their internal links are omitted.

Main entry points: [`src/ranbval_sdk/config/loader.py`](https://github.com/tariqdreamstech/ranbval-sdk/blob/main/src/ranbval_sdk/config/loader.py) (Config loader), [`src/ranbval_sdk/crypto/cipher.py`](https://github.com/tariqdreamstech/ranbval-sdk/blob/main/src/ranbval_sdk/crypto/cipher.py) (Token decryption), [`src/ranbval_sdk/telemetry/client.py`](https://github.com/tariqdreamstech/ranbval-sdk/blob/main/src/ranbval_sdk/telemetry/client.py) (Usage reporting), [`src/ranbval_sdk/remote/client.py`](https://github.com/tariqdreamstech/ranbval-sdk/blob/main/src/ranbval_sdk/remote/client.py) (Remote environments)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_config["Config and access"]
  node_api["SDK public API<br/>[__init__.py]"]
  node_loader["Config loader<br/>[loader.py]"]
  node_access["Secret access<br/>[access.py]"]
  node_manifest["Config manifest<br/>[manifest.py]"]
end

subgraph group_security["Secret protection"]
  node_cipher["Token decryption<br/>[cipher.py]"]
  node_repo["Repo allowlist<br/>[repo.py]"]
  node_guards["Output guards<br/>[output_guards.py]"]
  node_enforcement["Access enforcement<br/>[enforcement.py]"]
end

subgraph group_control["Control plane"]
  node_remote_env["Remote environments<br/>[client.py]"]
  node_proxy["Secure proxy<br/>[proxy.py]"]
  node_httpx["HTTPX adapter<br/>[httpx_transport.py]"]
  node_host["Host resolution<br/>[host.py]"]
  node_transport["HTTP transport<br/>[transport.py]"]
end

subgraph group_visibility["Audit and telemetry"]
  node_audit["Access audit<br/>[audit.py]"]
  node_monitor["Live Monitor<br/>[monitor.py]"]
  node_telemetry["Usage reporting<br/>[client.py]"]
  node_context["Client context<br/>[context.py]"]
  node_sampler["Usage sampling<br/>[sampling.py]"]
end

subgraph group_tools["CLI"]
  node_cli["Ranbval CLI<br/>[__init__.py]"]
  node_cli_init["Project initialization<br/>[init.py]"]
  node_cli_check["Config checking<br/>[check.py]"]
  node_cli_run["App runner<br/>[run.py]"]
end

node_app(("Application"))
node_control_plane{{"Ranbval control plane"}}

node_app -->|"uses"| node_api
node_api -->|"loads config"| node_loader
node_api -->|"exposes access"| node_access
node_loader -->|"checks config"| node_manifest
node_loader -->|"fetches envs"| node_remote_env
node_loader -->|"stores project secret"| node_cipher
node_loader -->|"installs guards"| node_guards
node_access -->|"loads config"| node_loader
node_access -->|"decrypts keys"| node_cipher
node_cipher -->|"checks repo"| node_repo
node_cipher -->|"reports use"| node_telemetry
node_cipher -->|"samples use"| node_sampler
node_repo -->|"fetches policy"| node_control_plane
node_remote_env -->|"requests envs"| node_control_plane
node_proxy -->|"forwards request"| node_control_plane
node_httpx -->|"adapts requests"| node_proxy
node_proxy -->|"resolves host"| node_host
node_proxy -->|"sends request"| node_transport
node_remote_env -->|"resolves host"| node_host
node_remote_env -->|"sends request"| node_transport
node_telemetry -->|"collects context"| node_context
node_telemetry -->|"resolves host"| node_host
node_telemetry -->|"sends event"| node_transport
node_monitor -->|"monitors use"| node_telemetry
node_monitor -->|"reads audit"| node_audit
node_cli -->|"dispatches init"| node_cli_init
node_cli -->|"dispatches check"| node_cli_check
node_cli -->|"dispatches run"| node_cli_run
node_cli_check -->|"checks config"| node_manifest
node_cli_check -->|"loads config"| node_loader
node_cli_run -->|"loads config"| node_loader

click node_api "https://github.com/tariqdreamstech/ranbval-sdk/blob/main/src/ranbval_sdk/__init__.py"
click node_loader "https://github.com/tariqdreamstech/ranbval-sdk/blob/main/src/ranbval_sdk/config/loader.py"
click node_access "https://github.com/tariqdreamstech/ranbval-sdk/blob/main/src/ranbval_sdk/config/access.py"
click node_manifest "https://github.com/tariqdreamstech/ranbval-sdk/blob/main/src/ranbval_sdk/config/manifest.py"
click node_remote_env "https://github.com/tariqdreamstech/ranbval-sdk/blob/main/src/ranbval_sdk/remote/client.py"
click node_cipher "https://github.com/tariqdreamstech/ranbval-sdk/blob/main/src/ranbval_sdk/crypto/cipher.py"
click node_repo "https://github.com/tariqdreamstech/ranbval-sdk/blob/main/src/ranbval_sdk/policy/repo.py"
click node_guards "https://github.com/tariqdreamstech/ranbval-sdk/blob/main/src/ranbval_sdk/crypto/output_guards.py"
click node_enforcement "https://github.com/tariqdreamstech/ranbval-sdk/blob/main/src/ranbval_sdk/crypto/enforcement.py"
click node_audit "https://github.com/tariqdreamstech/ranbval-sdk/blob/main/src/ranbval_sdk/crypto/audit.py"
click node_monitor "https://github.com/tariqdreamstech/ranbval-sdk/blob/main/src/ranbval_sdk/telemetry/monitor.py"
click node_telemetry "https://github.com/tariqdreamstech/ranbval-sdk/blob/main/src/ranbval_sdk/telemetry/client.py"
click node_context "https://github.com/tariqdreamstech/ranbval-sdk/blob/main/src/ranbval_sdk/telemetry/context.py"
click node_sampler "https://github.com/tariqdreamstech/ranbval-sdk/blob/main/src/ranbval_sdk/telemetry/sampling.py"
click node_proxy "https://github.com/tariqdreamstech/ranbval-sdk/blob/main/src/ranbval_sdk/integrations/proxy.py"
click node_httpx "https://github.com/tariqdreamstech/ranbval-sdk/blob/main/src/ranbval_sdk/integrations/httpx_transport.py"
click node_host "https://github.com/tariqdreamstech/ranbval-sdk/blob/main/src/ranbval_sdk/_internal/host.py"
click node_transport "https://github.com/tariqdreamstech/ranbval-sdk/blob/main/src/ranbval_sdk/_internal/transport.py"
click node_cli "https://github.com/tariqdreamstech/ranbval-sdk/blob/main/src/ranbval_sdk/cli/__init__.py"
click node_cli_init "https://github.com/tariqdreamstech/ranbval-sdk/blob/main/src/ranbval_sdk/cli/init.py"
click node_cli_check "https://github.com/tariqdreamstech/ranbval-sdk/blob/main/src/ranbval_sdk/cli/check.py"
click node_cli_run "https://github.com/tariqdreamstech/ranbval-sdk/blob/main/src/ranbval_sdk/cli/run.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_api,node_loader,node_access,node_manifest toneBlue
class node_cipher,node_repo,node_guards,node_enforcement toneAmber
class node_remote_env,node_proxy,node_httpx,node_host,node_transport toneMint
class node_audit,node_monitor,node_telemetry,node_context,node_sampler toneRose
class node_cli,node_cli_init,node_cli_check,node_cli_run,node_app,node_control_plane toneIndigo
```

## Components

### Config and access

- [SDK public API](https://github.com/tariqdreamstech/ranbval-sdk/blob/main/src/ranbval_sdk/__init__.py): `src/ranbval_sdk/__init__.py`
- [Config loader](https://github.com/tariqdreamstech/ranbval-sdk/blob/main/src/ranbval_sdk/config/loader.py): `src/ranbval_sdk/config/loader.py`
- [Secret access](https://github.com/tariqdreamstech/ranbval-sdk/blob/main/src/ranbval_sdk/config/access.py): `src/ranbval_sdk/config/access.py`
- [Config manifest](https://github.com/tariqdreamstech/ranbval-sdk/blob/main/src/ranbval_sdk/config/manifest.py): `src/ranbval_sdk/config/manifest.py`

### Secret protection

- [Token decryption](https://github.com/tariqdreamstech/ranbval-sdk/blob/main/src/ranbval_sdk/crypto/cipher.py): `src/ranbval_sdk/crypto/cipher.py`
- [Repo allowlist](https://github.com/tariqdreamstech/ranbval-sdk/blob/main/src/ranbval_sdk/policy/repo.py): `src/ranbval_sdk/policy/repo.py`
- [Output guards](https://github.com/tariqdreamstech/ranbval-sdk/blob/main/src/ranbval_sdk/crypto/output_guards.py): `src/ranbval_sdk/crypto/output_guards.py`
- [Access enforcement](https://github.com/tariqdreamstech/ranbval-sdk/blob/main/src/ranbval_sdk/crypto/enforcement.py): `src/ranbval_sdk/crypto/enforcement.py`

### Control plane

- [Remote environments](https://github.com/tariqdreamstech/ranbval-sdk/blob/main/src/ranbval_sdk/remote/client.py): `src/ranbval_sdk/remote/client.py`
- [Secure proxy](https://github.com/tariqdreamstech/ranbval-sdk/blob/main/src/ranbval_sdk/integrations/proxy.py): `src/ranbval_sdk/integrations/proxy.py`
- [HTTPX adapter](https://github.com/tariqdreamstech/ranbval-sdk/blob/main/src/ranbval_sdk/integrations/httpx_transport.py): `src/ranbval_sdk/integrations/httpx_transport.py`
- [Host resolution](https://github.com/tariqdreamstech/ranbval-sdk/blob/main/src/ranbval_sdk/_internal/host.py): `src/ranbval_sdk/_internal/host.py`
- [HTTP transport](https://github.com/tariqdreamstech/ranbval-sdk/blob/main/src/ranbval_sdk/_internal/transport.py): `src/ranbval_sdk/_internal/transport.py`

### Audit and telemetry

- [Access audit](https://github.com/tariqdreamstech/ranbval-sdk/blob/main/src/ranbval_sdk/crypto/audit.py): `src/ranbval_sdk/crypto/audit.py`
- [Live Monitor](https://github.com/tariqdreamstech/ranbval-sdk/blob/main/src/ranbval_sdk/telemetry/monitor.py): `src/ranbval_sdk/telemetry/monitor.py`
- [Usage reporting](https://github.com/tariqdreamstech/ranbval-sdk/blob/main/src/ranbval_sdk/telemetry/client.py): `src/ranbval_sdk/telemetry/client.py`
- [Client context](https://github.com/tariqdreamstech/ranbval-sdk/blob/main/src/ranbval_sdk/telemetry/context.py): `src/ranbval_sdk/telemetry/context.py`
- [Usage sampling](https://github.com/tariqdreamstech/ranbval-sdk/blob/main/src/ranbval_sdk/telemetry/sampling.py): `src/ranbval_sdk/telemetry/sampling.py`

### CLI

- [Ranbval CLI](https://github.com/tariqdreamstech/ranbval-sdk/blob/main/src/ranbval_sdk/cli/__init__.py): `src/ranbval_sdk/cli/__init__.py`
- [Project initialization](https://github.com/tariqdreamstech/ranbval-sdk/blob/main/src/ranbval_sdk/cli/init.py): `src/ranbval_sdk/cli/init.py`
- [Config checking](https://github.com/tariqdreamstech/ranbval-sdk/blob/main/src/ranbval_sdk/cli/check.py): `src/ranbval_sdk/cli/check.py`
- [App runner](https://github.com/tariqdreamstech/ranbval-sdk/blob/main/src/ranbval_sdk/cli/run.py): `src/ranbval_sdk/cli/run.py`

### Other components

- **Application**
- **Ranbval control plane**

## Connections

- Application → SDK public API: uses
- SDK public API → Config loader: loads config (evidence: `src/ranbval_sdk/__init__.py`)
- SDK public API → Secret access: exposes access (evidence: `src/ranbval_sdk/__init__.py`)
- Config loader → Config manifest: checks config (evidence: `src/ranbval_sdk/config/loader.py`)
- Config loader → Remote environments: fetches envs (evidence: `src/ranbval_sdk/config/loader.py`)
- Config loader → Token decryption: stores project secret (evidence: `src/ranbval_sdk/config/loader.py`)
- Config loader → Output guards: installs guards (evidence: `src/ranbval_sdk/config/loader.py`)
- Secret access → Config loader: loads config (evidence: `src/ranbval_sdk/config/access.py`)
- Secret access → Token decryption: decrypts keys
- Token decryption → Repo allowlist: checks repo (evidence: `src/ranbval_sdk/crypto/cipher.py`)
- Token decryption → Usage reporting: reports use (evidence: `src/ranbval_sdk/crypto/cipher.py`)
- Token decryption → Usage sampling: samples use (evidence: `src/ranbval_sdk/crypto/cipher.py`)
- Repo allowlist → Ranbval control plane: fetches policy (evidence: `src/ranbval_sdk/policy/repo.py`)
- Remote environments → Ranbval control plane: requests envs (evidence: `src/ranbval_sdk/remote/client.py`)
- Secure proxy → Ranbval control plane: forwards request
- HTTPX adapter → Secure proxy: adapts requests (evidence: `src/ranbval_sdk/integrations/httpx_transport.py`)
- Secure proxy → Host resolution: resolves host (evidence: `src/ranbval_sdk/integrations/proxy.py`)
- Secure proxy → HTTP transport: sends request (evidence: `src/ranbval_sdk/integrations/proxy.py`)
- Remote environments → Host resolution: resolves host (evidence: `src/ranbval_sdk/remote/client.py`)
- Remote environments → HTTP transport: sends request (evidence: `src/ranbval_sdk/remote/client.py`)
- Usage reporting → Client context: collects context (evidence: `src/ranbval_sdk/telemetry/client.py`)
- Usage reporting → Host resolution: resolves host (evidence: `src/ranbval_sdk/telemetry/client.py`)
- Usage reporting → HTTP transport: sends event (evidence: `src/ranbval_sdk/telemetry/client.py`)
- Live Monitor → Usage reporting: monitors use (evidence: `src/ranbval_sdk/telemetry/monitor.py`)
- Live Monitor → Access audit: reads audit (evidence: `src/ranbval_sdk/telemetry/monitor.py`)
- Ranbval CLI → Project initialization: dispatches init
- Ranbval CLI → Config checking: dispatches check
- Ranbval CLI → App runner: dispatches run
- Config checking → Config manifest: checks config (evidence: `src/ranbval_sdk/cli/check.py`)
- Config checking → Config loader: loads config (evidence: `src/ranbval_sdk/cli/check.py`)
- App runner → Config loader: loads config
