infisical-gateway
Skill36 starsChanged 3 months agoMITView on GitHub
Guide for the Infisical Gateway and Relay — reaching private network resources (VPC-only databases, on-premises directories, internal APIs, HSMs) from Infisical without any inbound firewall rules. Covers the gateway/relay architecture using SSH reverse tunnels, exact ports and egress allowlist requirements (TCP 2222 to the relay, TCP 443 to Infisical, TCP 8443 platform-to-relay), deployment with `infisical gateway start` and `infisical gateway systemd`, Infisical-managed vs self-deployed relays, Gateway Pools for high availability, health checks and heartbeat intervals, and which features and App Connection types can be routed through a gateway. Use this skill when someone asks about: Infisical Gateway, relay server, accessing a private database from Infisical, dynamic secrets for a database with no public endpoint, gateway pools, or 'Infisical cannot reach my internal resource'. A Gateway is not a substitute for self-hosting (infisical-self-host) and not an App Connection (infisical-app-connections) — private resources need both a gateway and a connection.
In this repository17 other files it gives its agents.
- AGENTS.mdAGENTS.md
- infisical-access-controlSkill
- infisical-agentSkill
- infisical-apiSkill
- infisical-app-connectionsSkill
- infisical-dynamic-secretsSkill
- infisical-kmsSkill
- infisical-kubernetes-operatorSkill
- infisical-pamSkill
- infisical-pkiSkill
- infisical-secret-rotationSkill
- infisical-secret-scanningSkill
- infisical-secret-syncsSkill
- infisical-self-hostSkill
- infisical-setupSkill
- infisical-ssoSkill
- infisical-terraformSkill
The file
We split this skill into the rules it gives an agent
2 rules. About 0 are common, 2 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 83
No inbound ports, ever: If a user is opening inbound firewall rules for a gateway, they have misunderstood the model.
- Distinctive: line 84
One gateway per isolated network: Not one per resource, and not one for everything.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Infisical Gateway Guide
You are a setup assistant helping users reach private network resources from Infisical.
The problem the Gateway solves: Infisical needs to talk to a database, directory, or API that has no public endpoint. The Gateway is a lightweight service you run inside your network that makes only outbound connections, so no inbound firewall rules are needed.
Gateway is a paid Enterprise feature.
Not this skill
The Gateway is a piece of shared plumbing, not a feature in itself. Users usually arrive because something else cannot reach a resource:
| If the user wants... | Use, then come back here for the gateway |
| Dynamic credentials for a private database | infisical-dynamic-secrets |
| An App Connection to a private host | infisical-app-connections |
| To rotate a credential on an internal system | infisical-secret-rotation |
| PAM sessions to internal infrastructure | infisical-pam |
| An internal CA (ADCS, Venafi) or an HSM | infisical-pki |
| To sync certificates to an on-prem load balancer | infisical-pki |
| A KMIP server | infisical-kms |
| To self-host Infisical itself | infisical-self-host |
A Gateway is not a substitute for self-hosting. Users sometimes think reaching private resources requires self-hosting Infisical. It does not — that is precisely what the Gateway is for. Cloud Infisical plus a Gateway reaches private resources without moving the platform.
A Gateway is also not an App Connection. The gateway provides the network path; the connection provides the credentials. Private resources need both.
Architecture
Two components:
| Component | Where it runs | What it does |
| Gateway | Inside your network | Proxies Infisical's requests to your private resources. Outbound-only |
| Relay server | Infisical-managed, or self-deployed | Routes encrypted traffic between the platform and your gateway. Never decrypts it |
The flow uses SSH reverse tunnels with certificate-based authentication:
- Registration — the gateway opens an outbound SSH reverse tunnel to a relay, using SSH certificates issued by Infisical
- Persistent connection — the gateway holds that TCP connection open, creating a channel for inbound requests
- Routing — when the platform needs your resource, the request goes through the relay and down the existing tunnel
- Access — the gateway connects to the private resource on Infisical's behalf
Traffic through the relay is double-encrypted, and the relay routes only — it cannot decrypt.
The rule about network placement
A gateway must sit in the same network as the resources it reaches, with direct connectivity to them. Separate networks, regions, or isolated environments each need their own gateway.
This is the most common design mistake: one gateway is expected to cover a whole estate. If the user has a prod VPC and a staging VPC with no route between them, that is two gateways.
How to use this skill
- Confirm a gateway is actually needed — is the resource genuinely unreachable publicly?
- Count the networks — one gateway per isolated network
- Decide relay strategy — Infisical-managed (simplest) or self-deployed (lower latency)
- Deploy the gateway and enroll it
- Verify the egress allowlist — this is where deployments stall
- Attach the gateway to the consuming connection or feature
- Consider a Gateway Pool for production HA
Reference files
| File | When to read |
references/deployment-and-networking.md | Deploying gateways and relays, exact ports and egress rules, systemd, health checks, troubleshooting |
references/pools-and-consumers.md | Gateway Pools for HA, which features and connection types accept a gateway |
Guiding principles
- No inbound ports, ever. If a user is opening inbound firewall rules for a gateway, they have misunderstood the model. The gateway dials out.
- One gateway per isolated network. Not one per resource, and not one for everything.
- Only 16 App Connection types accept a gateway. Passing
gatewayIdto any other type is a validation error, not a no-op. Seeinfisical-app-connections. gatewayIdandgatewayPoolIdare mutually exclusive. Specifying both fails.- Use a Gateway Pool for anything production. A single gateway is a single point of failure for every feature routed through it.
- Check egress before debugging anything else. Most "gateway won't connect" reports are a blocked outbound port.
- Gateways report health every 3 minutes; relays hourly. Know the intervals before concluding something is down.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

