> For the complete documentation index, see [llms.txt](https://coldbox-security.ortusbooks.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://coldbox-security.ortusbooks.com/v2.x-3/getting-started/first-chapter/rule-sources/untitled.md).

# DB Rules

If you have your security rules in a database, then cbsecurity can read the rules from the database for you.  Just **make** **the `rules` key  equal to `db`** and fill out the extra configuration keys shown below:

| Property       | Type   | Required | Default                   | Description                                                                                                                                                   |
| -------------- | ------ | -------- | ------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `rulesDSN`     | string | true     | ---                       | The dsn to use if the rules are coming from a database                                                                                                        |
| `rulesTable`   | string | true     | ---                       | The table where the rules are                                                                                                                                 |
| `rulesSQL`     | string | false    | `select* from rulesTable` | The custom SQL statement to use to retrieve the rules according to the rulesTable property. If not set, the default of select\* from rulesTable will be used. |
| `rulesOrderBy` | string | false    | ---                       | The column to order the rules by. If not chosen, the interceptor will not order the query, just select it.                                                    |

{% code title="config/Coldbox.cfc" %}

```javascript
moduleSettings = {
	// CB Security
	cbSecurity : {
		rules        : "db", // Rules are in the database
		rulesDSN     : "myDatasource", // The datasource
		rulesTable   : "securityRules", // The table that has the rules
		rulesOrderBy : "order asc" // An optional ordering
	}
};
```

{% endcode %}


---

# 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://coldbox-security.ortusbooks.com/v2.x-3/getting-started/first-chapter/rule-sources/untitled.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.
