# Add a new Third Party Sink

Applications are built by assembling third party libraries. Privado helps you track data flows to third parties. You can review existing rules for third party sinks at [`rules/sinks/third_parties`](https://github.com/Privado-Inc/privado/tree/main/rules/sinks/third_parties)

**List of fields for defining a third party sink:**

| Field      | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| ---------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `id`       | It is unique identifier for the third party sink. It has format `ThirdParties.SDK.` + Vendor Name ( without spaces and special characters )                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| `name`     | It is name of the third party                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| `patterns` | <p>It is an array of regex patterns for the third party sink. This regex will be used to search method names and to further check if data elements are going to the identified methods. Matching methods with data flows will be tagged for this third party sink.<br><br>Example: Mark specific method from a known class<br>class name: <code>com.privado.MySinkClass</code><br>method name: <code>mySinkMethod()</code><br>pattern: <code>com.privado.MySinkClass.mySinkMethod</code><br><br>Example: Mark all methods from a known class<br>class name: <code>com.privado.MySinkClass</code><br>method one: <code>mySinkMethod1()</code><br>method two: <code>mySinkMethod2()</code><br>pattern: <code>com.privado.MySinkClass.\*</code><br><br>Example: Mark a specific method across the classes<br>class name: <code>com.privado.MySinkClass</code><br>method one: <code>mySinkMethod()</code><br>class name: <code>com.privado.MySinkClass2</code><br>method one: <code>mySinkMethod()</code><br>pattern: <code>.\*mySinkMethod</code></p> |
| `tags`     | <p>It’s an object of key-value pairs. This is useful to group and filter third party sinks.<br>Example: you can tag applicable laws for the third party sinks.<br><br><code>tags:</code><br><code>laws: GDPR, HIPAA</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |

High level key is `sinks` which is an array of storages. Once the third party sink object is defined, we can add it to the array of sinks.

For a new vendor, you can create sub-directory with the vendor name under directory [`rules/sinks/third_parties/sdk`](https://github.com/Privado-Inc/privado/tree/main/rules/sinks/third_parties/sdk). You can create a language specific file - `java.yaml` and add the third party sink definition to it.

Once the new third party sink is added, Privado will detect and track data flows to this third party sink.


---

# Agent Instructions: 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:

```
GET https://docs.privado.ai/customizing-privado/add-a-third-party-sink.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
