---
title: Secure communication with APM agents
description: Communication between APM agents and Elastic Agent can be both encrypted and authenticated. It is strongly recommended to use both TLS encryption and...
url: https://docs-v3-preview.elastic.dev/elastic/docs-content/pull/1655/solutions/observability/apm/secure-communication-with-apm-agents
products:
  - APM
  - Elastic Observability
---

# Secure communication with APM agents
Communication between APM agents and Elastic Agent can be both encrypted and authenticated. It is strongly recommended to use both TLS encryption and authentication as secrets are sent as plain text.
- [TLS encryption](https://docs-v3-preview.elastic.dev/elastic/docs-content/pull/1655/solutions/observability/apm/apm-agent-tls-communication)
- [API key authentication](https://docs-v3-preview.elastic.dev/elastic/docs-content/pull/1655/solutions/observability/apm/api-keys)
- [Secret token authentication](https://docs-v3-preview.elastic.dev/elastic/docs-content/pull/1655/solutions/observability/apm/secret-token)

As soon as an authenticated communication is enabled, requests without a valid token or API key will be denied. If both API keys and a secret token are enabled, APM agents can choose whichever mechanism they support.
In some use-cases, like when an APM agent is running on the client side, authentication is not possible. See [Anonymous authentication](https://docs-v3-preview.elastic.dev/elastic/docs-content/pull/1655/solutions/observability/apm/anonymous-authentication) for more information.