> For the complete documentation index, see [llms.txt](https://thekarel.gitbook.io/best-practices/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://thekarel.gitbook.io/best-practices/the-outside-world/configuration.md).

# Runtime configuration

The runtime configuration should be picked up [from the environment](https://12factor.net/config) by the public interface instance - the HTTP layer in our example.

The entry point has to declare the list of configurations keys that it requires to work. The app throws an exception if any required values are missing since it won't be able to function correctly. Better to refuse to start than to throw an exception in the middle of a user journey.

Only the entry point should look at the environment; this is to ensure we define the required config keys in a single place. Picking up env vars in random places is a sure way to introduce problems that only happen when they really shouldn't (in production).

The same rule applies to the UI instances, whereas they pick up their config from environment variables, but they usually do that at *build time* since they are mostly static.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://thekarel.gitbook.io/best-practices/the-outside-world/configuration.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
