Administer
Resources
On this page
What a resource is
A resource is a backing service that Valet provisions for your organization and attaches to an app. Only apps hold resources. Artifacts and agents can't; for data they need, use a connector.
Attaching sets the resource's connection details as secret env vars on
the app. The app reads them like any other env var. To set the app's own
variables in the same restart, pass plain values in attach_resource's
plain_vars. Pass secret names in secret_names with a reason, and the
call returns a link to a page in your dashboard where you enter the
values. The resource is usable at once, and the app restarts once more
when you finish. Valet stores the
connection details encrypted. list_env_vars, or
valet env --app <name>, lists them with their values masked.
A resource belongs to the organization, not to an app. Its name is unique in the organization. Several apps can attach the same resource, and it outlives the apps that use it. Every organization member can create, attach, detach and destroy resources, except private systems, which only an Admin can.
list_catalog_resources, or valet resources catalog, lists the kinds
your installation offers. For each kind it shows the
plans, the env vars an attachment sets, and a guide that tells a coding
agent how to use it. Valet's built-in skills tell coding agents to
follow that guide.
Kinds of resources
PostgreSQL
Provider valet-postgresql. It gives an app an empty PostgreSQL
database, for records people enter or data that must outlast a restart.
The app creates its own tables when it starts.
A plan is a size and a tier, named like a process size. The size sets what the database can hold and how hard it can work. The tier says whether it sleeps. Every installation offers the same ten plans with the same limits:
economy-1x, standard-1x
- Storage
- 2 GiB
- Connections
- 20
- Compute in the cloud
- 0.25–0.5 vCPU
economy-2x, standard-2x
- Storage
- 4 GiB
- Connections
- 40
- Compute in the cloud
- 0.5–1 vCPU
economy-4x, standard-4x
- Storage
- 8 GiB
- Connections
- 80
- Compute in the cloud
- 1–2 vCPU
economy-8x, standard-8x
- Storage
- 16 GiB
- Connections
- 160
- Compute in the cloud
- 2–4 vCPU
economy-16x, standard-16x
- Storage
- 32 GiB
- Connections
- 320
- Compute in the cloud
- 4–8 vCPU
An economy database sleeps when nothing uses it and wakes on the next
connection. A standard database never sleeps. economy-1x is the
default.
DATABASE_URL
- Holds
- Connection URL, with the TLS settings the server needs
DATABASE_POOLED_URL
- Holds
- Connection URL through a connection pooler
DATABASE_HOST, DATABASE_PORT, DATABASE_NAME
- Holds
- Parts of the URL, for a library that can't take one
DATABASE_USER, DATABASE_PASSWORD
- Holds
- The database's login
PGSSLROOTCERT, NODE_EXTRA_CA_CERTS
- Holds
- The certificates drivers check the server against
Every app attached to one database gets the same login. Connections use
TLS, and apps verify the server's certificate: DATABASE_URL carries
sslmode=verify-full. PGSSLROOTCERT is for libpq-based libraries and
NODE_EXTRA_CA_CERTS for Node.js.
Inference
Provider valet-inference. It gives an app access to one AI model, for
server code that calls a model. Each plan is one exact model ID, such as
claude-sonnet-5; list_catalog_resources lists them.
| Env var | Holds |
|---|---|
LLM_BASE_URL | Base URL to pass to the vendor's SDK |
LLM_API_KEY | Key for this app's attachment |
LLM_MODEL | The exact model ID; requests for any other are refused |
LLM_PROVIDER | anthropic, openai or zai, which names the SDK to use |
The app calls Valet's inference endpoint, not the vendor. Valet records every request and response, and passes each request to the model's vendor. Two endpoints work: Anthropic Messages and OpenAI Chat Completions. Valet refuses others, such as embeddings and the OpenAI Responses API.
Each attachment gets its own key, so two apps that share one inference resource hold different keys. The key has no expiry. Detaching the resource stops the key from working.
Private systems
A private system is a service inside your own network, such as a production database, that an app can reach. It exists only in a dedicated installation. The cloud offers none.
The team that runs the installation defines each system and its plans.
A plan is one level of access, such as readonly or readwrite, and
fixes the network addresses and ports an app holding it can reach. The
catalog lists a system as <system>:<plan>, with a guide for the
Admin and the names of the env vars to fill, such as DATABASE_URL.
Valet provisions nothing. The resource holds the credentials an Admin
enters, and the app reads them as secret env vars like any other
resource. The network path and the credentials arrive together, and
only while the approval holds.
Only apps hold private systems, not agents. An app that holds one starts cold, because a running instance can't change its network access. An app can hold only a few at a time, and one app can't hold plans that need different subnets.
Only an Admin can create, attach, move to another plan, detach or
destroy a private system, even where an organization doesn't enforce
roles. An Admin creates the resource with
valet resources create, which prompts for each credential without
showing it and needs a terminal. An agent can't run it.
No MCP tool does this. Use the CLI.
Attaching, or moving to another plan, takes effect only when an Admin
confirms it in person in the dashboard. A Developer, an agent, or an
Admin who uses the CLI or an MCP tool gets a request instead. The CLI
prints a link and exits 0. The tool answers requested with a link, and
the problem private_system.approval_required names the app and plan.
Asking again for the same plan and app returns the pending request.
Ask your agent:
Give the debugger app read-only access to the reporting database.attach_resource
{ "name": "debugger", "resource": "reporting-db-readonly" }An Admin approves or declines the request within 24 hours. In the
dashboard, open Governance, then Access requests. The request
waits under Needs your attention, and a badge on Governance counts
it.
valet resources lists them below the resources. A request that nobody
answers expires, and Valet applies nothing.
Detaching and destroying need no approval, but only an Admin can do
them. Valet refuses to start an app that is still attached to a plan
the operator has removed, with private_system.missing. An Admin
detaches it.
Lifecycle
Create
A resource is created for the app that first needs it:
attach_resource
{ "name": "shop", "resource": "orders-db", "provider": "valet-postgresql", "plan": "economy-1x" }Valet records the resource and provisions it in the background, usually
within a minute. The first attach_resource call returns while it
provisions, and your agent
repeats the call until the resource is attached. With --app,
valet resources create waits for provisioning and then attaches.
list_resources, or valet resources info <name>, shows whether it's ready.
Name a resource for what it holds, such as orders-db, not for the
app.
Attach
Another app attaches an existing resource by name:
attach_resource
{ "name": "reports", "resource": "orders-db" }Attaching writes the resource's env vars onto the app and restarts it.
The resource must finish provisioning before it can attach. Valet
records the attachment first and completes it even if a failed restart
or a deploy interrupts it. get_service shows its status.
Attach refuses when any env var it would set already exists on the app,
including one set for the whole organization. A conflict that appears
later, such as an organization value that now shadows one of the
resource's, leaves the attachment waiting until you change the name or
detach. To give an app two resources that set the same names, attach the
second with a prefix, "env_prefix": "EVENTS" or --prefix EVENTS,
which sets EVENTS_DATABASE_URL and the rest. PGSSLROOTCERT and
NODE_EXTRA_CA_CERTS keep their names under a prefix, because drivers
read only those names; two databases on one app share them.
The resource's env vars are ordinary secrets on the app, and Valet doesn't guard them: if someone unsets or overwrites one, the app sees that change. Valet never overwrites a value someone else set.
Detach
detach_resource
{ "name": "reports", "resource": "orders-db" }Detaching removes the env vars the attachment wrote and restarts the app. A variable someone changed after the attach stays, and Valet names it. The resource and its data stay. Other apps that hold the resource keep it.
Change plan
set_resource_plan
{ "resource": "orders-db", "plan": "economy-4x", "preview": true }A preview shows each limit before and after, how much the database
uses now, and what an attached app notices. It changes nothing. Valet
refuses a smaller plan the data would not fit. The database keeps its
data and its env vars, so attached apps don't restart. In the cloud, a
new size closes open connections once while the database restarts on
it. A change between economy and standard at the same size closes
nothing. A sleeping database stays asleep and wakes on its new size.
Destroy
destroy_resource
{ "resource": "orders-db" }Destroying deletes the resource and its data, and can't be undone. It
refuses while any app holds the resource; detach it from each app
first, or pass --force to the CLI to detach every app at once. The
provider removes the database in the background.
Destroying an app detaches its resources and keeps them. Destroy them separately when nothing needs their data.
Limits
An organization can hold 100 resources, and an app can attach 10, by default. Unattached resources count toward the organization limit. Valet can change both limits for an organization.
Valet has no command to back up or restore a resource.
Commands and MCP tools
List kinds and plans
- MCP tool
list_catalog_resources- CLI
valet resources catalog
List the organization's resources
- MCP tool
list_resources- CLI
valet resources
Show one resource
- MCP tool
list_resources- CLI
valet resources info
Create
- MCP tool
attach_resourcewithprovider- CLI
valet resources create
Attach
- MCP tool
attach_resource- CLI
valet resources attach
Change plan
- MCP tool
set_resource_plan- CLI
valet resources update
Detach
- MCP tool
detach_resource- CLI
valet resources detach
Destroy
- MCP tool
destroy_resource- CLI
valet resources destroy
The dashboard's Governance, Access requests page lists every request, including those for private systems. The dashboard shows an app's resources, their state, and their plan's limits on the app's page, and changes a resource's plan from there. Create, attach, detach and destroy them with MCP tools or the CLI. For an example of asking a coding agent, see Data access.
Next steps
- Add a database to an app: see a complete attachment example.
- Data access: compare resources, connectors and env vars.