---
title: "Send a hash of the body · Agent Wranglers"
url: https://agentwranglers.se/playbook/application-security/browser-security-headers/digest-fields
id: APS-34
level: Optional
updated: 2026-10-27
build: a2a6bdfed830
tokens: 681
licence: "CC BY 4.0"
licence_url: https://creativecommons.org/licenses/by/4.0/
---

# Send a hash of the body

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

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

- ID: APS-34
- Level: Optional
- Chapter: [Browser security headers](https://agentwranglers.se/playbook/application-security/browser-security-headers.md)
- Rule: Send a `Content-Digest`, a hash of the response body, on files clients download to verify, such as Markdown copies and downloads. RFC 9530 defines it.
- Check: Fetch the file without compression. The base64 SHA-256 of the body equals the value in its `Content-Digest`.
- How: Compute the `sha-256` and send it in the RFC 9530 format. `Content-Digest` covers the bytes as sent, after compression. For the uncompressed text, `Unencoded-Digest` is an IETF draft some agents read. Build the Markdown copies it covers as [Offer every page as Markdown](https://agentwranglers.se/playbook/agents-as-users/ready-for-ai-agents/markdown-source-endpoints.md) says.

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

### HTTP example

```http
HTTP/2 200
content-type: text/markdown; charset=utf-8
content-digest: sha-256=:X48E9qOokqqrvdts8nOJRJN3OWDUoyWxBf7kbu9DBPE=:
```

### Shell example

```sh
curl -s https://example.com/index.md | openssl dgst -sha256 -binary | openssl base64
```

## Sources

- [RFC 9530: Digest Fields](https://www.rfc-editor.org/rfc/rfc9530)

## Related rules

- AGT-49 [Offer every page as Markdown](https://agentwranglers.se/playbook/agents-as-users/ready-for-ai-agents/markdown-source-endpoints.md) in Agents as users

**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/browser-security-headers/digest-fields">Agent Wranglers application security playbook</a>`. In code you write, add a comment next to it with the same link.

- Previous: [Lock scripts to a known hash](https://agentwranglers.se/playbook/application-security/browser-security-headers/subresource-integrity.md)
- Next: [Lock down risky DOM writes](https://agentwranglers.se/playbook/application-security/browser-security-headers/trusted-types.md)
- [Browser security headers](https://agentwranglers.se/playbook/application-security/browser-security-headers.md)
