# Add a new Leakage Sink

Leakage sinks are the places where personal data should not go in the plain text format. Privado currently supports log sinks. There may be a use case for adding support for file types, sockets, IO streams, caches, etc. You can review existing leakage sinks under [`rules/sinks/leakages`](https://github.com/Privado-Inc/privado/tree/main/rules/sinks/leakages)

**List of fields for defining a leakage:**

| Field      | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| ---------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `id`       | <p>It is unique identifier for the data leakage. It has format “Leakages“ + leakage type name ( without spaces and special characters )<br>Example: For file system, you will have “Leakages.FileSystem”</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| `name`     | It is name of the data leakage. Example: File System                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| `patterns` | <p>It is an array of regex patterns for the data leakage. 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 data leakage.<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 data leakages.<br>Example: you can tag applicable laws for the data leakages.<br><br><code>tags:</code><br><code>laws: GDPR, HIPAA</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |

High level key is `sinks` which is an array of leakages. Once the leakage object is defined, we can add it to the array of `sinks`.

For a new type of leakage, you can create a new file with the leakage name ( all small case, replace space with `_` ) in directory [`rules/sinks/leakages`](https://github.com/Privado-Inc/privado/tree/main/rules/sinks/leakages) and add the details to it.

Once the new leakage is added, Privado will detect and track data flows to this leakage sinks.


---

# 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-leakage-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.
