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

The New Relic Ruby 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. If high-security mode or the default settings do not work for your business needs, you can apply custom settings.

For more information about New Relic's security measures, see our [security and privacy documentation](https://docs.newrelic.com/docs/security/new-relic-security/data-privacy/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 Ruby agent handles the following potentially sensitive data:

-   [Request parameters](https://docs.newrelic.com/docs/agents/ruby-agent/configuration/ruby-agent-configuration#capture_params): The agent does not capture HTTP request parameters.
-   [HTTPS](https://docs.newrelic.com/docs/agents/ruby-agent/configuration/ruby-agent-configuration#ssl): The agent communicates with New Relic using HTTPS.
-   [SQL](https://docs.newrelic.com/docs/agents/ruby-agent/configuration/ruby-agent-configuration#transaction_tracer-record_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/ruby-agent/configuration/ruby-agent-configuration#high_security), the [default settings](#default) are locked so that users cannot change them. In addition, the agent does not collect message queue parameters.

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

-   [Ruby agent configuration file](https://docs.newrelic.com/docs/agents/ruby-agent/configuration/ruby-agent-configuration)
-   [Custom attributes](https://docs.newrelic.com/docs/agents/ruby-agent/attributes/enabling-disabling-attributes-ruby)
-   [Ruby agent API](https://docs.newrelic.com/docs/agents/ruby-agent/api-guides/ruby-agent-api-guide)
-   [Custom instrumentation](https://docs.newrelic.com/docs/agents/ruby-agent/customization/ruby-custom-instrumentation)
-   [Custom SSL certificates](https://docs.newrelic.com/docs/agents/ruby-agent/configuration/custom-ssl-certificates-ruby)

| **Setting**                                                                                                                                                              | **Effects on data security**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [`audit_log.enabled`](https://docs.newrelic.com/docs/agents/ruby-agent/configuration/ruby-agent-configuration#audit_log-enabled) _boolean_                               | Default: `false` By default, the agent does not log all data sent to New Relic in the agent log file. If you set this to `true`: - The agent logs data sent to the New Relic collector in the agent log file. You can then evaluate the information that the agent sends by reviewing the agent log file to see if it includes sensitive information. - All endpoints are included in the agent log file. You can specify that only certain endpoints should be included in the audit log by using [`audit_log.endpoints`](https://docs.newrelic.com/docs/agents/ruby-agent/configuration/ruby-agent-configuration#audit_log-endpoints). |
| [`high_security`](https://docs.newrelic.com/docs/agents/ruby-agent/configuration/ruby-agent-configuration#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.                                                                                                                                                                                                                                                                                                                                            |
| [`proxy_host`](https://docs.newrelic.com/docs/agents/ruby-agent/configuration/ruby-agent-configuration#proxy_host) _string_                                              | Default: (none) Some proxies default to using HTTP, which is a less secure protocol.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| [`attributes.enabled`](https://docs.newrelic.com/docs/agents/ruby-agent/configuration/ruby-agent-configuration#attributes-enabled) _boolean_                             | Default: `true` By default, you are sending [attributes](https://docs.newrelic.com/docs/agents/ruby-agent/attributes/enabling-disabling-attributes-ruby) to New Relic. If you do not want to send attributes to New Relic, set this to `false`.                                                                                                                                                                                                                                                                                                                                                                                          |
| [`attributes.exclude`](https://docs.newrelic.com/docs/agents/ruby-agent/configuration/ruby-agent-configuration#attributes-exclude) _array_                               | Default: `[]` If there are specific attribute keys that you do **not** want to send to New Relic in transaction traces, identify them using `attributes.exclude`. This restricts the information sent to New Relic. Consider if you want to exclude these potentially sensitive attributes using `attributes.exclude` or if you need this information sent to New Relic: - `request.headers.*`: Removes all request headers. (Note that HTTP headers that contain sensitive data such as `cookie` and `authorization` are never collected.) - `response.headers.*`: Removes all response headers.                                        |
| [`transaction_tracer.record_sql`](https://docs.newrelic.com/docs/agents/ruby-agent/configuration/ruby-agent-configuration#transaction_tracer-record_sql) _string_        | Default: `obfuscated` By default, `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 `none`. - 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`.                                                                                                                                                                                                           |
| [`strip_exception_messages.enabled`](https://docs.newrelic.com/docs/agents/ruby-agent/configuration/ruby-agent-configuration#strip_exception_messages-enabled) _boolean_ | Default: the value of the `high_security` configuration option By default, this is set to `false`, which means that the agent sends messages from all exceptions to the New Relic collector. If you enable [high-security mode](#restricted), this is automatically changed to `true`, and the agent strips the messages from exceptions. If you are not using high-security mode but still want to strip messages from all exceptions except those in your [allow list](https://docs.newrelic.com/docs/agents/ruby-agent/configuration/ruby-agent-configuration#strip_exception_messages-whitelist), set this to `true`.                |
