---
title: APM agent security: PHP
source: https://docs.newrelic.com/docs/apm/agents/php-agent/getting-started/apm-agent-security-php
---

The PHP agent default security settings automatically provide [security for your APM data](https://docs.newrelic.com/docs/using-new-relic/new-relic-security/security/apm-agent-data-security) to ensure data privacy and to limit the kind of information New Relic receives. You may have business reasons to change these settings.

If you want to restrict the information that New Relic receives, you can enable [high-security mode](#restricted). If high-security mode or the default settings do not work for your business needs, you can apply [custom](#custom) settings.

For more information about New Relic's security measures, see our [security and privacy documentation](https://docs.newrelic.com/docs/using-new-relic/new-relic-security/security/security-matters-data-privacy-new-relic), or visit the [New Relic security website](https://newrelic.com/security).

## Default security settings [#default]

By default, here is how the New Relic PHP agent handles the following potentially sensitive data:

-   [Request parameters](https://docs.newrelic.com/docs/agents/php-agent/attributes/attribute-examples#ex_req_params): The agent does not capture HTTP request parameters.
-   [HTTPS](https://docs.newrelic.com/docs/agents/php-agent/configuration/php-agent-configuration#inivar-daemon-ssl): The agent communicates with New Relic using HTTPS.
-   [SQL](https://docs.newrelic.com/docs/agents/php-agent/configuration/php-agent-configuration#inivar-tt-sql): The agent sets SQL recording to `obfuscated`, which removes the potentially sensitive numeric and string literal values.

## High-security mode settings [#restricted]

When you [enable high-security mode](https://docs.newrelic.com/docs/agents/php-agent/configuration/php-agent-configuration#inivar-high-security), the [default settings](#default) are locked so that users cannot change them. In addition:

-   You cannot create [custom events](https://docs.newrelic.com/docs/agents/php-agent/php-agent-api/newrelic_record_custom_event).
-   The agent strips exception messages from errors.

## Custom security settings [#custom]

> #### ⚠️ CAUTION
>
> If you customize security settings, it may impact the security of your application.

If you need different security settings than default or high-security mode, you can customize these settings:

-   [PHP agent configuration file](https://docs.newrelic.com/docs/agents/php-agent/configuration/php-agent-configuration)
-   [Attribute settings](https://docs.newrelic.com/docs/agents/php-agent/configuration/php-agent-configuration#inivar-attribute-settings)
-   [PHP agent API](https://docs.newrelic.com/docs/agents/php-agent/api-guides/php-agent-api-guide)

| **Setting**                                                                                                                                                                        | **Effects on data security**                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [`newrelic.daemon.auditlog`](https://docs.newrelic.com/docs/agents/php-agent/configuration/php-agent-configuration#inivar-daemon-auditlog) _string_                                | Default: (none) If you use this to set the name of the audit log file, the agent will log details of messages passed back and forth between the monitored process and the New Relic collector. You can then evaluate the information that the agent sends to the New Relic collector to see if it includes sensitive information.                                                                                                                                                                     |
| [`newrelic.high_security`](https://docs.newrelic.com/docs/agents/php-agent/configuration/php-agent-configuration#inivar-high-security) _boolean_                                   | Default: `false` To enable [high-security mode](#restricted), set this to `true` and [enable high security in New Relic](https://docs.newrelic.com/docs/agents/manage-apm-agents/configuration/high-security-mode#version2enabled). This restricts the information you can send to New Relic.                                                                                                                                                                                                         |
| [`newrelic.daemon.proxy`](https://docs.newrelic.com/docs/agents/php-agent/configuration/php-agent-configuration#inivar-daemon-proxy) _string_                                      | Default: (none) Some proxies default to using HTTP, which is a less secure protocol.                                                                                                                                                                                                                                                                                                                                                                                                                  |
| [`newrelic.attributes.enabled`](https://docs.newrelic.com/docs/agents/php-agent/configuration/php-agent-configuration#inivar-attributes-enabled) _boolean_                         | Default: `true` By default, you are sending [attributes](https://docs.newrelic.com/docs/agents/php-agent/attributes/enabling-disabling-attributes) to New Relic. If you do not want to send attributes to New Relic, set this to `false`.                                                                                                                                                                                                                                                             |
| [`newrelic.attributes.exclude`](https://docs.newrelic.com/docs/agents/php-agent/configuration/php-agent-configuration#inivar-attributes-include-exclude) _string_                  | Default: (none) If there are specific attribute keys that you do **not** want to send to New Relic in transaction traces, identify them using `newrelic.attributes.exclude`. This restricts the information sent to New Relic. Consider if you want to exclude these potentially sensitive attributes using `newrelic.attributes.exclude` or if you need the information sent to New Relic: - `request.headers.*`: Removes all request headers. - `response.headers.*`: Removes all response headers. |
| [`newrelic.custom_insights_events.enabled`](https://docs.newrelic.com/docs/agents/python-agent/configuration/python-agent-configuration#custom-insights-events-settings) _boolean_ | Default: `true` By default, the agent records events sent to the Event API via [`newrelic_record_custom_event()`](https://docs.newrelic.com/docs/agents/php-agent/php-agent-api/newrelic_record_custom_event). If you enable [high-security mode](#restricted), this is automatically set to `false`.                                                                                                                                                                                                 |
| [`newrelic.transaction_tracer.record_sql`](https://docs.newrelic.com/docs/agents/php-agent/configuration/php-agent-configuration#inivar-tt-sql) _string_                           | Default: `obfuscated` By default, `newrelic.transaction_tracer.record_sql` is set to `obfuscated`, which strips out the numeric and string literals. - If you do not want the agent to capture query information, set this to `off`. - If you want the agent to capture all query information in its original form, set this to `raw`. - When you enable [high-security mode](#restricted), this is automatically set to `obfuscated`.                                                                |
