> For the complete documentation index, see [llms.txt](https://docs.stoobly.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.stoobly.com/core-concepts/agent/proxy-settings/filter-rules.md).

# Filter Rules

{% hint style="info" %}
**Configures:**

* Which requests to record/mock?
  {% endhint %}

{% hint style="info" %}
Filter rules are applied after [data rules](/core-concepts/agent/proxy-settings/data-rules.md).
{% endhint %}

This section provides fine-grained configuration to control which requests are recorded, mocked or replayed. Rules are applied if a request URL matches the provided regex **pattern.**

## Rule Configuration

<figure><img src="/files/IUX8TNyMGcE6J9DI9S52" alt=""><figcaption><p>Figure 1. Filter rule</p></figcaption></figure>

## Rule Components

### Method

HTTP verb(s) the rule applies to such as GET, POST, DELETE, etc.

### Pattern

Pattern to match with the request URL to apply the rule to. This supports regular expressions.

### Action

Whether to include or exclude requests that match.

### Modes Applied To

Which agent mode to apply the filter rule to such as mock, record and/or replay

## Example

For example, maybe you want to exclude recording requests that generate OAuth tokens. And let's assume that the endpoint is `POST https://internal.company.com/v1/token` . You can then create a rule with the following values:

* Method - `POST`
* Pattern - `https://internal.company.com/v1/token`
* Action - `Exclude`
* Modes Applied To - `Record`

##


---

# 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://docs.stoobly.com/core-concepts/agent/proxy-settings/filter-rules.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.
