> For the complete documentation index, see [llms.txt](https://docs.luciq.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.luciq.ai/product-guides-and-integrations/product-guides/luciq-pii-masking/network-log-masking.md).

# Network Log Masking

Network obfuscation and masking take place on the client side; masked data is never sent to the servers. There are two layers: automatic masking of known-sensitive keys, and manual obfuscation/omission controlled by the developer.

#### Automatic header & query-parameter masking

Starting with SDK version 14.2.0, the SDK automatically masks a defined set of keys from network headers and query parameters so that no sensitive value reaches the servers. The key name is still shown on the dashboard, but its value is replaced with an asterisk (\*). This feature is enabled by default and is strongly recommended to stay enabled.

<table><thead><tr><th width="139.0234375" valign="top">Category</th><th valign="top">Keys masked (value replaced with *)</th></tr></thead><tbody><tr><td valign="top">Authorization</td><td valign="top"><mark style="background-color:purple;">Authorization</mark>, <mark style="background-color:purple;">authorization_token</mark>, <mark style="background-color:purple;">auth_token</mark>, <mark style="background-color:purple;">auth</mark> , <mark style="background-color:purple;">access_token</mark>, <mark style="background-color:purple;">token</mark> , <mark style="background-color:purple;">oauth_token</mark>, <mark style="background-color:purple;">bearer_token</mark>, <mark style="background-color:purple;">refresh_token</mark>, <mark style="background-color:purple;">jwt_token</mark>, <mark style="background-color:purple;">jwt</mark></td></tr><tr><td valign="top">Login</td><td valign="top"><mark style="background-color:purple;">username</mark> , <mark style="background-color:purple;">password</mark>, <mark style="background-color:purple;">pwd</mark></td></tr><tr><td valign="top">API keys</td><td valign="top"><mark style="background-color:purple;">api_key</mark>, <mark style="background-color:purple;">apikey</mark></td></tr><tr><td valign="top">Secrets</td><td valign="top"><mark style="background-color:purple;">secret</mark> , <mark style="background-color:purple;">client_secret</mark>, <mark style="background-color:purple;">app_secret</mark>, <mark style="background-color:purple;">consumer_secret</mark></td></tr></tbody></table>

{% hint style="info" %}
**Adding keys:** The masked-key list is configurable server-side. New keys can be added without any code change and apply from the next session — the list is managed by Luciq support (not self-serve); contact support to extend it.
{% endhint %}

***

#### Enabling / disabling automatic network masking

Although enabled by default, automatic network masking can be turned off per platform if absolutely necessary:

***Kotlin***

```
Instabug.setNetworkAutoMaskingState(Feature.State.DISABLED)
```

***Java***

```
Instabug.setNetworkAutoMaskingState(Feature.State.DISABLED);
```

***swift***

```
NetworkLogger.autoMaskingEnabled = false
```

***Objective-c***

```
IBGNetworkLogger.autoMaskingEnabled = false;
```

***

#### Manual obfuscation & omission

Beyond automatic key masking, developers can obfuscate specific request/response content or omit a request entirely. The APIs differ per platform:

#### Omit a whole request

**Android**

Android routes obfuscation/omission through the interceptor + listener model (LuciqOkhttpInterceptor, LuciqNetworkLog), with an API to remove the listener. [here](https://docs.luciq.ai/android/set-up-luciq-for-android/logs-and-profiling/unified-network-interception#modifying-network-logs)

**iOS**

```
let path = \"/products\"
let requestPredicate = NSPredicate(format: \"URL.path MATCHES %@\", path)
let responsePredicate = NSPredicate(format: \"statusCode >= %d AND statusCode <= %d\", 200, 399)
NetworkLogger.setNetworkLoggingRequestFilterPredicate(requestPredicate, responseFilterPredicate: responsePredicate)
```

**ReactNative**

<pre><code><strong>NetworkLogger.setRequestFilterExpression(
</strong>  "network.requestHeaders['accept'] === 'application/json'");
</code></pre>

**Flutter**

```
NetworkLogger.omitLog((data) => data.url.contains('/payment'));
```

#### Obfuscate parts (without dropping the request)

**iOS**

```
// Obfuscate Request
NetworkLogger.setRequestObfuscationHandler { (request) -> URLRequest in
    var myRequest:NSMutableURLRequest = request as! NSMutableURLRequest
    let urlString = request.url?.absoluteString
    urlString = obfuscateAuthenticationTokenInString()
    let obfuscatedURL = URL(string: urlString)
    myRequest.url = obfuscatedURL
    return myRequest.copy() as! URLRequest
}

//Obfuscate Response
NetworkLogger.setResponseObfuscationHandler { (data, response, completion) in
    if let data = data {
        let modifiedData = self.modify(data: data)
        let modifiedResponse = self.modify(response: response)
        
        completion(modifiedData, modifiedResponse)
    }
}
```

**ReactNative**

```
NetworkLogger.setNetworkDataObfuscationHandler(async (networkData) => {
  networkData.requestHeaders = { 'Content-Type': 'application/json' };
  return networkData;
});
```

**Flutter**

```
NetworkLogger.obfuscateLog((data) {
  data.requestHeaders.remove('Authorization');
  return data;
});
```

{% hint style="info" %}
Find more at each platform docs [Android](https://docs.luciq.ai/references/report-data/logging/network-logging-android), [iOS](https://docs.luciq.ai/references/report-data/logging/network-logging-ios#omitting-requests-from-logs), [ReactNative](https://docs.luciq.ai/react-native/setup-luciq-for-react-native/logs-and-profiling/report-logs#omitting-requests) and [Flutter](https://docs.luciq.ai/flutter/setup-luciq-for-flutter/logs-and-profiling/report-logs#obfuscating-data)
{% endhint %}

***

#### Payload masking options

* Entire request/response payloads can be omitted based on request or response details.
* Selective masking can be applied, masking only the sensitive parts of the payload. In practice this is the obfuscation handler in 3.3 used selectively — clear or rewrite a single field rather than the whole payload, e.g. Flutter data.responseBody = '' or React Native networkData.response = {}.
* All payload masking happens client-side; masked data never reaches the servers.


---

# 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.luciq.ai/product-guides-and-integrations/product-guides/luciq-pii-masking/network-log-masking.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.
