Field References
Use field references to connect a resource’s config field to another resource’s output. When the referenced resource updates, the dependent resource automatically receives the new value.api_key field is a FieldReference — a structured pointer to another resource’s output. The format is:
| Key | Description | Example |
|---|---|---|
provider | Provider of the referenced resource | pragma |
resource | Resource type | secret |
name | Resource name | anthropic-key |
field | Output field path (must start with outputs.) | outputs.api_key |
anthropic-key updates, pragma-os re-resolves the field reference and sends the new value to the claude model’s provider.
Dependency[T] Pattern
For provider authors,Dependency[T] declares a whole-resource dependency. Instead of referencing a single output field, the provider receives the entire resolved resource — its config, outputs, and metadata.
claude model resource updates, pragma-os re-resolves the dependency and sends the updated model data to the agent’s provider. The provider then decides how to handle the change (e.g., rebuild the agent with the new model).
FieldReference vs Dependency[T]: Use a FieldReference when you need a single value from another resource (like a connection URL or API key). Use
Dependency[T] when the provider needs the full resource context to operate.Order-Independent Apply
You can apply resources in any order. If a resource’s dependencies aren’t ready yet, pragma-os stores it inpending state and automatically processes it once all dependencies become available.
Change Propagation
When a resource reachesready state, pragma-os checks for dependents and propagates changes:
- Ready dependents — Re-resolved with fresh data and sent back to their provider for update
- Pending dependents (waiting for deps) — Checked to see if all dependencies are now ready; if so, resolved and submitted for initial processing
ready, pragma-os then checks B’s dependents and propagates further.
Resolved Config
When a resource transitions topending state with all dependencies ready, pragma-os creates a resolved_config — a copy of the config where all FieldReferences and Dependency markers have been replaced with actual values. This is what gets sent to the provider.
You can inspect the resolved config to debug dependency resolution:
config (your original declaration with references) and resolved_config (the fully resolved version sent to the provider).
Dependency Rules
Circular dependencies are not allowed. If A depends on B, B cannot depend on A — this prevents infinite update loops. Changes cascade downward. When a resource updates, all resources that depend on it are notified and can react to the change. Deletion detaches dependents. When you delete a resource, its dependents are detached (references removed) rather than cascade-deleted. The provider decides whether the dependent can continue without the deleted resource. See Deletion Behavior for details.Next Steps
Resources
Understand resource lifecycle and states.
Reactive Pipelines Guide
Build multi-resource pipelines with automatic change propagation.