# Codex agent internet access

Codex has full internet access
[during the setup phase](https://platform.openai.com/docs/codex/overview#setup-scripts).
After setup, control is passed to the agent. Due to elevated security and safety
risks, Codex defaults internet access to **off** but allows enabling and
customizing access to suit your needs.

## Risks of agent internet access

**Enabling internet access exposes your environment to security risks**

These include prompt injection, exfiltration of code or secrets, inclusion of
malware or vulnerabilities, or use of content with license restrictions. To
mitigate risks, only allow necessary domains and methods, and always review
Codex's outputs and work log.

As an example, prompt injection can occur when Codex retrieves and processes
untrusted content (e.g. a web page or dependency README). For example, if you
ask Codex to fix a GitHub issue:

```markdown
Fix this issue: https://github.com/org/repo/issues/123
```

The issue description might contain hidden instructions:

```markdown