# Database passwords fill themselves

Save a password once in the Valakes vault and bind it to psql or mysql on a host. Valakes answers the prompt itself, and the password stays out of the command.

Source: https://valakes.com/features/password-auto-fill/

Last updated: 2026-11-27

Save a password once, bind it to a tool on a host, and Valakes answers that tool's password prompt for you. Your screen and your history keep a placeholder, never the value.

## Where the password lives

Passwords, tokens and key passphrases live in the vault, under Settings, Credentials and vault. Each value is encrypted with AES-256-GCM, and the key that opens the vault is wrapped by your operating system: your account's protection on Windows, the Keychain on macOS. A value is opened only in Valakes' main process, at the moment it is sent.

The use case [keeping a few servers in one place](https://valakes.com/use-cases/a-few-servers/) shows auto-fill next to the files panel and broadcast, for someone who looks after only a few servers.

## How it works

A credential becomes useful once you bind it to a tool on a host. The binding tells Valakes which saved value belongs to `psql` on this server, and whether to fill it without asking. After that you run the command as you always do, and Valakes answers the prompt when it appears.

1. Type the command, for example `psql -U app -h db`. If no credential is bound to `psql` on this host, a card offers Add a binding.
2. Pick a saved credential, or add one.
3. A chip under the composer shows what Valakes will do. With Auto-fill on it names the credential; with Auto-fill off it asks, for example "Fill with pg?".
4. Run the command. When the program asks for its password, Valakes checks that the prompt is genuine and sends the value once, straight from its main process to the server connection.

## Three ways a value reaches the server

A password in a command's arguments is visible on the server in `ps` and stays in its history, so Valakes avoids putting it there. It uses the safest way the tool allows: the answer to the tool's own prompt first, its standard input next, and the command line only as a last resort, which you must allow.

| Way            | When                                                             | What it means                                                                                         |
| -------------- | ---------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- |
| Prompt         | The program asks, as `psql` does                                 | The value goes once from the main process to the connection; not through the window, history or a log |
| Standard input | The program reads stdin, as `docker login --password-stdin` does | A small helper in your shell reads it with echo off                                                   |
| Inline         | No other way, as `curl -u user:{{cred:http}}`                    | In the server's process list, maybe its history, and your scrollback; you allow it, an agent never    |

## What it does not do

Auto-fill closes the usual ways a password leaks, but it cannot change how the program on the server behaves, and it can hide only the values it knows. Use these limits to decide where a restricted server account is the better answer.

- If the program exits in the instant between its prompt and the answer, the answer can land at the shell prompt and enter the server's history. Valakes narrows this window and masks the echo on your screen.
- Masking hides only values saved in the vault, and not the shortest ones. A password in a `.env` file is unknown to Valakes.

## Questions

### Which tools does auto-fill know?

The built-in rules cover `psql`, `mysql`, `mongosh`, `redis-cli`, `curl`, `docker login`, `sudo`, `git`, `ssh` and `scp`.

### What happens if someone copies my data folder?

The vault cannot be opened on another computer or under another account. Valakes lists the credentials as needing re-entry and deletes nothing until you confirm.

### Can an AI agent use a saved password?

Yes, without seeing it. The agent writes `{{cred:name}}` and Valakes answers the prompt itself. It works only for a binding with Auto-fill on, and never by the inline way.

## Related features

- [Dangerous commands wait for you](https://valakes.com/features/command-check/): The command check reads each command you type before it runs. A dangerous one stops on a card that says why, and it runs only when you choose.
- [AI agents work under your rules](https://valakes.com/features/ai-agents/): Valakes has a local API that lets an AI agent such as Claude Code or Codex open sessions and run commands on the hosts you allow. The agent never sees a password, and changes wait for your approval.

## Documentation

[Read the docs: Credentials and auto-fill](https://docs.valakes.com/credentials/)

[Something not working? Help centre: The password was not filled in](https://support.valakes.com/the-password-was-not-filled-in/)

## Guide

[Guide: How do I type psql or mysql on a server without pasting the password?](https://valakes.com/guides/auto-fill-a-database-password-over-ssh/)

## With an AI agent

An agent works on your servers under the host policies and approvals you set. Setup for each client:

- [Claude Code](https://valakes.com/agents/claude-code/)
- [Codex](https://valakes.com/agents/codex/)
- [Cursor](https://valakes.com/agents/cursor/)
- [MCP clients](https://valakes.com/agents/mcp-clients/)
- [REST API](https://valakes.com/agents/rest-api/)
