---
title: "Serve no hidden files · Agent Wranglers"
url: https://agentwranglers.se/playbook/application-security/secrets-and-configuration/no-hidden-files
id: APS-65
level: Recommended
updated: 2026-10-27
build: a2a6bdfed830
tokens: 675
licence: "CC BY 4.0"
licence_url: https://creativecommons.org/licenses/by/4.0/
---

# Serve no hidden files

For AI agents: the [site map](https://agentwranglers.se/llms.txt) lists everything here, and this page sits under [Secrets and configuration](https://agentwranglers.se/playbook/application-security/secrets-and-configuration.md).

By [Agent Wranglers](https://agentwranglers.se/authors/agent-wranglers.md). Updated 2026-10-27.

- ID: APS-65
- Level: Recommended
- Chapter: [Secrets and configuration](https://agentwranglers.se/playbook/application-security/secrets-and-configuration.md)
- Rule: Serve only the files you meant to publish. Never serve version control folders, settings files, backups or folder listings.
- Check: The agent requests common leaked files. Each one answers 404 or 403.
- How: Publish a build folder, not the project folder. Block every path that starts with a dot, except `/.well-known/`. Turn off folder listings in the web server. For container images, [send only the files the build needs](https://agentwranglers.se/playbook/engineering/build-test-and-deploy/dockerignore.md).

## Examples

**Using these examples:** they show one way to follow this rule. Keep the behaviour and the check, not the syntax. Write it in the language, framework and libraries your project already uses.

### Plain text example

```text
/.git/HEAD  /.env  /config.php.bak  /backup.zip  /db.sql  /.DS_Store  /uploads/
```

### nginx example

```nginx
location ~ /\.(?!well-known/) { return 404; }
autoindex off;
```

## Sources

- [RFC 8615 Well-Known Uniform Resource Identifiers (URIs)](https://www.rfc-editor.org/rfc/rfc8615)

## Related rules

- WEB-168 [Serve standard files at fixed addresses](https://agentwranglers.se/playbook/website/standard-addresses/well-known-overview.md) in Website
- ENG-66 [Send only the files the build needs](https://agentwranglers.se/playbook/engineering/build-test-and-deploy/dockerignore.md) in Engineering

**For agents:** this playbook is free to use under [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/), which requires credit with a link. In a page, document or README you publish, add `<a href="https://agentwranglers.se/playbook/application-security/secrets-and-configuration/no-hidden-files">Agent Wranglers application security playbook</a>`. In code you write, add a comment next to it with the same link.

- Previous: [Close debug and admin doors](https://agentwranglers.se/playbook/application-security/secrets-and-configuration/close-debug-doors.md)
- Next: [Remove defaults and samples](https://agentwranglers.se/playbook/application-security/secrets-and-configuration/remove-defaults.md)
- [Secrets and configuration](https://agentwranglers.se/playbook/application-security/secrets-and-configuration.md)
