> For the complete documentation index, see [llms.txt](https://developer.harness.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.harness.io/web-application-and-api-protection-protection-protection/getting-started-with-protection.md). Agents can also search and read this documentation through its [MCP server](https://developer.harness.io/~gitbook/mcp).

# Getting Started with Protection

Learn how to configure Traceable Protection to monitor API traffic, detect threats, configure security policies, and enforce blocking rules to protect APIs and web applications from malicious activity

Modern applications rely on APIs, web applications, and frequent user interactions, all of which are frequent targets of attacks. Protection continuously monitors live traffic, detects malicious activity, and enforces security policies without disrupting legitimate requests. Protection builds on your API inventory, combining multiple protection capabilities into a single enforcement layer.

## Protection components <a href="#runtime-protection-components1" id="runtime-protection-components1"></a>

Protection comprises five components, each responsible for managing a different type of threat. The following table discusses each component and its purpose:

| Component                           | Purpose                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| ----------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **WAF Policies**                    | Protect against common web attacks and OWASP API Top 10 threats. Policies are organized into policy tabs, profiles, overrides, and threat types, and include a set of aggressive rules that catch more attacks at a higher false-positive risk. For more information, see [WAF Policies](https://developer.harness.io/web-application-and-api-protection-protection-protection/settings/web-application-firewall-policies/profiles-and-overrides-in-waf-policies.md).                         |
| **API Protection Policies**         | Detect API-specific threats, including session violations, JWT anomalies, and account takeover attempts. For more information, see [API Protection Policies](https://developer.harness.io/web-application-and-api-protection-protection-protection/settings/api-protection-policies.md).                                                                                                                                                                                                      |
| **Bot & Abuse Protection Policies** | Detect and mitigate credential stuffing, scraping, and other automated attacks. You can tune detection per environment using custom entities to automate traffic. For more information, see [Bot and Abuse Protection Policies](https://developer.harness.io/web-application-and-api-protection-protection-protection/bot-protection/bot-and-abuse-protection-policies.md).                                                                                                                   |
| **AI Firewall Policies**            | Protect AI applications against Prompt Text Evasion and Misdirection, Prompt Injection, PII Detected in Prompt, Model Governance, Code Detected in Prompt, AI Rate Limiting, AI Input Explosion, and Toxic Unsafe Content. For more information, see [AI Firewall Policies](https://developer.harness.io/ai-security/use-ai-security/ai-firewall-policies.md).                                                                                                                                |
| **Custom Policies**                 | Assign threat scores, identify malicious actors, configure auto-blocking, and manage IP allowlists. Custom policies also govern the progression from a monitored user to threat actor. For more information, see [Custom Policies](https://developer.harness.io/web-application-and-api-protection-protection-protection/settings/custom-policies.md) and [Threat Scoring](https://developer.harness.io/web-application-and-api-protection-protection-protection/settings/threat-scoring.md). |

***

## Monitor and block modes <a href="#monitor-and-block-modes" id="monitor-and-block-modes"></a>

Protection policies enforce traffic in one of two modes:

* **Monitor (Monitoring Mode):** Traceable detects and reports malicious activity but does not block any requests. Use this mode to evaluate detections, validate policy behavior, and tune configurations against your real traffic. New policies start in monitoring mode by default.
* **Block (Blocking Mode):** Traceable enforces the policy and blocks the requests that match it. Enable blocking after you confirm that the policy accurately identifies malicious activity with minimal false positives.

How you set the mode depends on the policy type:

* **WAF policies:** Select a profile, **Monitoring** or **Blocking Mode**, in the **All Environments** view. This profile is the baseline, and every environment inherits it unless you override the profile or the action of a threat type or rule for that environment. For more information, see [WAF Policies](https://developer.harness.io/web-application-and-api-protection-protection-protection/settings/web-application-firewall-policies/profiles-and-overrides-in-waf-policies.md).
* **Bot and Abuse Protection and custom policies:** Set the action for each policy or rule, such as **Monitor**, **Block**, or **Allow**.

Blocking also depends on how you instrument your application. For example, blocking is not supported through eBPF agents.

***

## Before you begin <a href="#before-you-begin" id="before-you-begin"></a>

Before you enable Protection, complete the following:

* Complete your deployment and instrumentation, including your Tracing Agent (TA) strategy for every environment in scope, whether that is an edge gateway, a sidecar, a language agent, eBPF, an agentless mirror, or a serverless extension. For more information, see [Traceable Deployment](https://github.com/harness/harness-developer-hub/tree/main/docs/security/web-application-api-protection/product-overview/readme/traceable-deployment.md).
* Verify that **Discovery** is receiving traffic and populating your API inventory. For more information, see [Discovery](https://github.com/harness/harness-developer-hub/tree/main/docs/security/web-application-api-protection/discovery/discovery.md).

{% hint style="info" %}
If you use an eBPF agent for instrumentation, confirm your kernel version meets the minimum requirement. Blocking is not supported through eBPF agents.
{% endhint %}

***

## Steps to configure protection <a href="#steps-to-configure-runtime-protection2" id="steps-to-configure-runtime-protection2"></a>

To configure Protection on your system, complete the following steps:

<figure><img src="https://2980762203-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FBBzsBPdnelPInnO54ysg%2Fuploads%2Fgit-blob-071421e0bfe3291bdcff1830d18e1be8f030f3a1%2FGSWP.png?alt=media" alt=""><figcaption></figcaption></figure>

### Step 1: Instrument your application <a href="#step-1-instrument-your-application2" id="step-1-instrument-your-application2"></a>

Configure your deployment so Traceable can inspect your application traffic. Select the tracing method that best matches your environment, such as an *edge deployment*, a language agent, an eBPF agent, an agentless deployment, or a serverless extension.

Generate a platform API token before you install any agents. Deploy the Traceable Platform Agent (TPA) using Helm, Terraform, or the installation script, and verify the installer signature before deployment. After you complete the deployment, verify that traces appear in the Traceable platform and confirm that the TPA redacts sensitive data before it leaves your environment.

{% hint style="info" %}
**Note**

Blocking is not supported through eBPF agents. If a workload requires inline blocking, choose a gateway, sidecar, or language agent for that workload instead.
{% endhint %}

### Step 2: Enable Protection policies in monitoring mode <a href="#step-2-enable-protection-policies-in-monitoring-mode1" id="step-2-enable-protection-policies-in-monitoring-mode1"></a>

Enable the WAF, API Protection, Bot and Abuse Protection, and AI Firewall policies in monitoring mode across all in-scope environments. New policies start in monitoring mode by default, allowing you to evaluate detections, validate policy behavior, and tune configurations before enforcing actions. Configure the following policy categories:

* **WAF policies**

  Enable the required WAF policies. Use the policies page to review profiles, threat type groups, and overrides, then monitor detections and refine rule behavior based on your application traffic. For more information, see [WAF Policies](https://developer.harness.io/web-application-and-api-protection-protection-protection/settings/web-application-firewall-policies/profiles-and-overrides-in-waf-policies.md).
* **API Protection policies**

  Enable the following API Protection policies:

  * **Session violations:** Detects token reuse, session anomalies, and invalid session context.
  * **JWT anomalies:** Detects malformed or tampered JWTs and claim abuse patterns.
  * **Account takeover:** Detects credential stuffing and account takeover attempts.

    For more information, see [API Protection Policies](https://developer.harness.io/web-application-and-api-protection-protection-protection/settings/api-protection-policies.md).
* **Bot and Abuse Protection policies**

  Enable the Bot and Abuse Protection policies to detect and mitigate credential stuffing, scraping, and other automated attacks. You can tune detection per environment using custom entities. For more information, see [Bot and Abuse Protection Policies](https://developer.harness.io/web-application-and-api-protection-protection-protection/bot-protection/bot-and-abuse-protection-policies.md).
* **AI Firewall policies**

  If your environment includes AI applications, enable the AI Firewall policies to protect them against threats such as prompt injection, PII detected in prompts, and toxic or unsafe content. For more information, see [AI Firewall Policies](https://developer.harness.io/ai-security/use-ai-security/ai-firewall-policies.md).

Review policy detections and tune thresholds, exceptions, overrides, and rule configurations as needed. After validating that the policies accurately identify malicious activity with minimal false positives, you can enable blocking mode.

### Step 3: Configure custom policies <a href="#step-3-configure-threat-management" id="step-3-configure-threat-management"></a>

Configure your threat scores, including severity adjustments based on response codes, so that a request returning a sensitive error carries more weight than one that returns a harmless error. Configure your auto-blocking thresholds next, along with your actor progression rules governing the path from anomaly to monitored user to threat actor, so that an actor who keeps returning is contained more quickly on each subsequent attempt rather than starting over.

Define IP allowlists for known-good actors, such as internal vulnerability scanners, so that Traceable does not classify your own team or trusted partners as threats. Keep in mind that threat scores prioritize malicious activity, but they do not block traffic on their own unless you have also configured auto-blocking.

You can use custom policies to go beyond the default signatures and tailor protection to your environment. You can create allow, monitor, and block rules for each environment to catch novel payloads and behaviors that standard rules do not cover. The following examples show common ways to use custom policies. For more information, see [Custom Policies](https://developer.harness.io/web-application-and-api-protection-protection-protection/settings/custom-policies.md).

### Step 4: Transition to blocking mode <a href="#step-3-enable-api-protection-policies2" id="step-3-enable-api-protection-policies2"></a>

Promote policies from monitoring to block mode in phases. Start with high-confidence, non-aggressive rules in development or staging, validate detections, and tune thresholds, exceptions, and overrides. After you minimize false positives, promote the policies to production and enable additional rules incrementally.

The way you promote a policy depends on its type:

* **WAF policies**: Switch the profile from **Monitoring** to **Blocking Mode**. If you change the profile in the **All Environments** view, the change applies to every environment that has no override. To promote in phases, override the profile for one environment at a time instead.
* **Bot and Abuse Protection and custom policies:** Change the action of the policy or rule from **Monitor** to **Block**.

#### Step 5: Monitor and maintain <a href="#step-5-monitoring-and-maintainence" id="step-5-monitoring-and-maintainence"></a>

You can view the dashboard and confirm that the **Total Traffic**, **Total** **Threat Traffic**, **Blocked Threat Traffic**, and **Monitored Threat Traffic** metrics are populating.

<figure><img src="https://2980762203-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FBBzsBPdnelPInnO54ysg%2Fuploads%2Fgit-blob-bec81b03d99879f82e660a5607fa342a4baca8b5%2FDashboard%20(1).png?alt=media" alt="" width="563"><figcaption><p>AI Firewall Dashboard</p></figcaption></figure>

You can set up notifications so that you are notified about detections and blocked threats. You can send notifications to email addresses, Slack, S3, Splunk, Syslog, HTTP Event Collector, Google SecOps, or a custom webhook. For more information, see [Notification](https://github.com/harness/harness-developer-hub/tree/main/docs/security/web-application-api-protection/integrations/notifications/notification.md).

To keep Protection effective over time, do the following:

* Ensure that you monitor the [Threat Actors](https://developer.harness.io/web-application-and-api-protection-protection-protection/web-app-api-protection/threat-actors.md) and [Threat Activity](https://developer.harness.io/web-application-and-api-protection-protection-protection/web-app-api-protection/threat-activity.md) dashboards daily, alongside your issue queue, to identify active attacks and spot opportunities for policy tuning.
* Ensure that you review policies, rule configurations, false-positive rates, and the [WAF Policies Changelog](https://docs.traceable.ai/v1/docs/wap-policies-changelog) weekly to stay current with newly introduced and updated protection policies.
* Ensure that you review your third-party APIs and AI assets monthly to identify newly introduced external dependencies.
* Ensure that you audit your API inventory quarterly so that new services are protected and deprecated endpoints are removed from your policies.

As your deployment matures, continue refining your policies to reduce false positives. Monitor long-term trends through dashboards and security events, and extend your protection by enabling capabilities such as Data Loss Prevention (DLP) and enumeration detection as your security requirements evolve. For more information, see [Dashboards](https://developer.harness.io/web-application-and-api-protection-protection-protection/web-app-api-protection/dashboards.md) and [Security Events](https://developer.harness.io/web-application-and-api-protection-protection-protection/web-app-api-protection/security-events.md).

***

## Sample use-case scenarios <a href="#demo" id="demo"></a>

The following scenarios show how you can use Traceable policies to protect your APIs from unwanted traffic, starting with geo-fencing and then a traffic flood:

<details>

<summary><strong>Geo-fencing access policy</strong></summary>

The following table describes the scenarios in detail:

| Scenario                              | Situation                                                                                    | What Traceable Does                                                                                |
| ------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- |
| Allow only the countries you serve    | Your API serves customers in a few countries, but requests arrive from many others.          | Allows traffic from the listed countries and blocks the rest.                                      |
| Block sanctioned or hostile regions   | Your compliance team requires that no traffic from restricted geographies reaches your APIs. | Blocks requests from the listed countries or regions and records the blocked attempts as evidence. |
| Limit a partner API to its own region | A partner-facing API is meant for one region, but it is reachable worldwide.                 | Restricts that API to the partner's region and leaves your other APIs unaffected.                  |

</details>

<details>

<summary><strong>L7 DDoS / flood anomaly policy</strong></summary>

The following table describes the scenarios in detail:

| Scenario                                  | Situation                                                                       | What Traceable Does                                                         |
| ----------------------------------------- | ------------------------------------------------------------------------------- | --------------------------------------------------------------------------- |
| Flood from an allowed region              | Traffic from a country you allow suddenly spikes and slows your API.            | Detects the flood pattern and applies mitigation while the spike lasts.     |
| Flood that stays under static rate limits | Many sources each send a small number of requests, so no single limit triggers. | Detects the combined pattern that static rate limits miss and mitigates it. |
| Attack spike during peak business hours   | A flood starts during your busiest period and puts uptime at risk.              | Mitigates the flood in real time so legitimate users keep access.           |

</details>

<i class="fa-duotone">:duotone:</i><br>
