# Which is more secure, the Agent or the Edge Agent?

From a network security perspective, Agents and Edge Agents operate in opposite directions. In the case of the standard Agent, it is the Agent listening for connections and Portainer connecting to it. Inversely for Edge Agents, it is Portainer listening for connections and the Edge Agent that connects to Portainer.

In terms of which is more secure, this will depend on your particular setup and security posture. In most cases, the Edge Agent is likely to be the more secure option simply because the scope of concern can focus on just the Portainer instance itself. Using Edge Agent there is no need to design every Agent network to have a port open for Portainer to connect to. As you add more Edge Agents, there is only one system, the Portainer instance, that would require its ports to be exposed.


---

# 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.portainer.io/sts/faqs/getting-started/which-is-more-secure-the-agent-or-the-edge-agent.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.
