1. Write the tool
The tool receives git’s request,protocol, host, and path, and returns username and password. This one mints a GitHub App installation token for one repository on an allowlist. GitHub expires it within an hour.
tool-server.ts
TILDE_TOOL_HOST_TOKEN set, and keep the private key on the server only. See Add a Tilde tool server. The Python SDK provides the same API in tilde.tool_hosts.
When a process in a sandbox calls a tool, ctx.sandboxId names the sandbox. ctx.agentId and ctx.threadId name the agent and thread it was launched for, when the reuse mode ties it to one. In Python, they are context.sandbox_id, context.agent_id, and context.thread_id. Use them to scope credentials further.
2. Switch the tool on for the blueprint
Open the blueprint in Sandboxes, and select Tools. Add the tool server, and switch ongit_credentials. Processes call it by the source’s slug and the tool name. This guide assumes the slug creds, so the tool is creds.git_credentials.
Do not give this tool to the agent. Git fetches the credential itself when it needs one.
3. Point git at it
Git runs a credential helper withget, and writes the request to its standard input as key=value lines. This helper calls the tool through the local API, and prints the lines git expects.
git-credential-tilde
credential.useHttpPath makes git send the repository path, which the tool needs.
Dockerfile
execute_tool creds.git_credentials span under the sandbox.exec that ran git. A repository off the allowlist fails with the tool’s error.
Other systems
The same pattern works for anything a process in the sandbox must reach:- Package registries. Return a short-lived npm, PyPI, or container registry token, and fetch it from a credential helper.
- Cloud CLIs. Return temporary credentials, such as AWS STS credentials for one role, through the CLI’s credential process setting.
- Databases. Return a short-lived database user or IAM authentication token.