> For the complete documentation index, see [llms.txt](https://docs.hardpoint.dev/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.hardpoint.dev/guides/hardpoint-enterprise/master.md). Agents can also search and read this documentation through its [MCP server](https://docs.hardpoint.dev/~gitbook/mcp).

# Architecture

Detailed breakdown of the Hardpoint Connect architecture

## Introduction

Hardpoint Connect is a zero-trust networking layer for edge infrastructure. In concrete terms, that means that these are non-negotiable features:

* Safe and secure means of establishing a connection between two different service providers
* First-class support for well known FaaS vendors
* Zero-trust principles for authentication & authorization (`authn` and `authz`), traffic routing and monitoring
* Privacy: data sent across the network is not readable by intermediaries, even if they're malicious/compromised

***

## Architectural overview

<figure><img src="https://2526368186-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M6ethR3Ps0sh2kxOxdm%2Fuploads%2Fv5lRXuDuYD8qNzcHNo32%2FGroup%2017.svg?alt=media&amp;token=5f542a8b-f5ba-494b-a10a-1ac00de7e2ca" alt=""><figcaption></figcaption></figure>

### Key components

#### Agent

Agents are lightweight, standalone programs (daemons) that run inside your infrastructure. They establish outbound-only connections to the routing mesh via the QUIC protocol, in order to set up private tunnels between SDK clients and your private infrastructure (e.g. databases).

In [Hardpoint Lattice](https://docs.hardpoint.dev/guides/hardpoint-lattice.md), agents are directly embedded inside each tenant database VM, giving a guarantee of end-to-end encryption

#### SDK

A compact client library you embed into your serverless code to connect to your private Hardpoint network.

{% hint style="info" %}
You are not required to use the SDK in order to work with Hardpoint Connect, however it is the focus of our DevEx optimizations. If you'd like to see an implementation in another language, we'd love your feedback. Ping us on [Discord](https://discord.gg/WWE4PWVnb2) or [X](https://x.com/h7tlabs) any time!
{% endhint %}

#### Routing mesh

The routing mesh connects traffic from SDK requests to agents downstream. It's responsible for:

* Hardening of public ingress points, if enabled
* Authenticating incoming SDK calls and Agent connections
* Authorization of SDK calls to downstream services
* Observability & rate-limiting

The routing mesh evaluates Ingress and Service rules from the [Control Plane API](https://docs.hardpoint.dev/platform-architecture.md#control-plane-api). It is **not** able to intercept traffic, since it's protected by the [open tunneling protocol](https://github.com/hardpointlabs/agent/blob/master/PROTOCOL.md).

***

### Key Resources

#### Ingress Rules

These control admission into the Connect network. These are CEL[^1] expressions which validate claims of credentials issued by trusted identity providers. See the [Rules page](https://docs.hardpoint.dev/guides/hardpoint-enterprise/getting-started/create-rules.md) for more information.

#### Service Rules

These determine whether traffic can enter a service. These are CEL expressions validating properties of a request context. See the [Rules page](https://docs.hardpoint.dev/guides/hardpoint-enterprise/getting-started/create-rules.md) for more information.

#### Agents

[Agents](#agents) are lightweight daemons terminating Connect traffic. They must authenticate into the Connect network either by means of a manually approved `Ed25519` key-pair, or by proving they are part of a predefined [Agent Group](#agent-groups).

#### Agent Groups

Agent Groups allow the automatic admission of agents from a known trusted source based on OIDC claims (for example, a pod in a K8s cluster). In environments such as K8s or Hardpoint Lattice where large numbers of ephemeral agents will be present, this is the preferred means of tunnel termination.

#### Services

A service is a named reference to a real `host:port` pair, accessible from an agent(s). Access to a service is gated by a [Service Rule](#service-rules).

***

### Database System Overview

The below diagram shows the layout of an illustrative application that uses separate fleets for 3 different domain objects in their system: orders, invoices and payments. You're free to deploy like this, or consolidate all tenant data in your system into one single fleet.

In the example, tenants are partitioned across 2 regions, Hetzner/Falkenstein (`de-hetzner-fkb`) for EU-resident customers, and AWS/us-east-1 for US customers (`us-aws-iad`).&#x20;

<figure><img src="https://2526368186-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M6ethR3Ps0sh2kxOxdm%2Fuploads%2FM7kgEgzrmf7icADJuDsU%2FGroup%2028.svg?alt=media&amp;token=853bad84-83d3-415c-893e-29e5268935dc" alt=""><figcaption></figcaption></figure>

Placement is decided based on predefined [tenant placement rules](https://docs.hardpoint.dev/guides/hardpoint-enterprise/managing-tenant-placement.md); databases themselves are created on-demand if they do not already exist for a particular tenant.

***

### Tenant Database Overview

Each blue square in the system diagram represents one distinct database instance. Each instances' data is fully isolated:

* **In flight** - using Hardpoint Connect's secure [tunneling protocol](https://github.com/hardpointlabs/agent/blob/master/PROTOCOL.md) which cryptographically separates traffic, regardless of the underlying transport protocol or cloud provider
* **At rest** - using dedicated volume encryption keys, [optionally held by your customers](https://docs.hardpoint.dev/guides/hardpoint-lattice/byok.md)

Every instance runs inside a [Firecracker](https://firecracker-microvm.github.io/) MicroVM. It consists of 3 layers, described in the following diagram:

{% columns %}
{% column %}

<figure><img src="https://2526368186-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M6ethR3Ps0sh2kxOxdm%2Fuploads%2FtKzjsDWuQYftArunfSnH%2FGroup%2027.svg?alt=media&amp;token=16c07f48-1bbc-4f17-afe3-cdc7ad87425d" alt=""><figcaption></figcaption></figure>
{% endcolumn %}

{% column %}

#### Full isolation

**Agent**\
A Hardpoint Connect Agent, establishing an outbound-only connection to the upstream routing mesh. Tenant DBs do not accept inbound connections.

**Database**\
The Invar instance. Handles actual queries.

**Storage Layer**\
Tenant DBs persist to dedicated [OpenZFS](https://en.wikipedia.org/wiki/OpenZFS) volumes with individual encryption keys. The storage layer is responsible for obtaining keys and handling backups.<br>
{% endcolumn %}
{% endcolumns %}

***

### Key Resources

These are owned and managed by Hardpoint.

#### Tenants

Concretely, a tenant in Hardpoint is a unique opaque string representing a tenant in your system. Hardpoint maps this to their sovereign region so databases can be placed appropriately.

#### Fleets

Fleets are groupings of tenant databases which all perform the same function in your application. They share a uniform database configuration, but each tenant can have separate keys. Fleets can span multiple sovereign regions.

#### Databases

Databases are the processes running the actual workload; they're responsible for handling traffic, parsing queries and reading/writing data from long term storage.

***

## Appendix

### Entity relationship diagram

This diagram illustrates the relationship between key resources in Hardpoint Connect. See the Platform Architecture page for more information about other important resources

```mermaid
erDiagram
    ORG ||--o{ AGENT : has
    ORG ||--o{ AGENT_GROUP : has
    ORG ||--o{ INGRESS_RULE : has

    AGENT_GROUP ||--o{ AGENT : contains
    AGENT_GROUP ||--o{ SERVICE : owns

    SERVICE ||--o{ SERVICE_RULE : has
```

[^1]: Common Expression Language
