Skip to main content
See Configuration for ~/.formal/config.toml.

Authentication

List Resources

Interactive TUI with:
  • ↑/k - Move up
  • ↓/j - Move down
  • enter - Connect to resource
  • / - Filter resources
  • q - Quit
  • ? - Show help

Connect to Resources

Databases (PostgreSQL, MySQL, MongoDB)

Then connect with your database client:
Formal automatically injects your credentials - no username/password needed! Note that the database name is required for the connection to be successful. You can also use the --launch argument to launch the appropriate CLI program after connecting (for example psql or ssh), e.g.

Specify Native User

To request a Native User instead of the Resource’s assigned default, append its label using formal@<native_user_label>.
See Native Users for label selection and policy controls.

Specify Resource Hostname

If a resource has multiple Resource Hostnames (for example, separate reader and writer endpoints), target one by appending @<hostname-name> to the resource name:
Resource hostname targeting is currently supported for PostgreSQL and MySQL resources.
Connect with your database client as usual, using the port from the formal connect output:
Use the same RESOURCE_NAME@HOSTNAME_NAME target to disconnect:

SSH

This updates your ~/.ssh/config automatically.

Configure SSH without write access

Formal adds the following block to the top of ~/.ssh/config on your first SSH connection:
If Formal cannot modify this file, add the block manually before any Host entries. Then run formal connect <resource-name> again. Formal writes subsequent SSH resource changes to ~/.formal/ssh_config.

Kubernetes

This updates your ~/.kube/config to route through the Connector.

HTTP

The local listener serves plain HTTP and adds Formal credentials to each request before forwarding it to the Connector over TLS. Any HTTP client works as long as its base URL can point to the local listener, with no Transparent Mode or X-Formal-User-* headers required.

Snowflake

Point your Snowflake driver at the local listener over plain HTTP, for example host="localhost", port=9000 and protocol="http" with the Python connector. The Endpoint attaches your device information to each request before forwarding it to the Connector over TLS. The driver logs in with the same credentials it would use against the Connector directly.

Disconnect

Run a Command Under a Scope

Use formal run to give an application its own scope, separate from your other tools:
formal run registers itself with the Formal Desktop app, then replaces itself with the command, which keeps its process. Traffic from the command and its child processes carries the my-app scope. Network rules read it as scope, for example to forward the application’s traffic to its own resource:
Policies and Native User hooks read it as input.device.scope, for example to inject the application’s API key instead of yours:
Any process you run can register its own scope, so input.device.scope does not prove which application sent a request. Use it to pick between credentials the caller is already allowed to use. For a privileged credential, also check the caller’s identity, such as input.user.groups.
The Formal Desktop app must be running when the command starts. The scope survives a restart of the app. Scopes work on macOS and Linux. A child process loses the scope once the command is no longer its ancestor, for example when it detaches to run in the background, or when another app starts it, as open does.

Decrypt Data

Decrypt Formal-encrypted data:

S3 Operations

The Formal s3 command automatically routes traffic to the right Connector so your users don’t have to worry about formatting the right parameters for S3. Interact with S3 through Formal:
See AWS CLI S3 commands for more operations.