# Custom policies and policy packaging

*MuleSoft Developer II Study Guide · Implement maintainable and modular Mule applications and their Maven builds · Last updated November 7, 2026 · https://www.certifyforce.com/study-guide/mulesoft-developer-ii/implement-maintainable-and-modular-mule-applications-and-their-maven-builds/custom-policies-and-policy-packaging*

Build Mule 4 policy artifacts, trace their source and operation boundaries, and distinguish runtime implementation from configurable policy metadata.

- Certification: Salesforce MuleSoft Developer II
- Exam section: Implement maintainable and modular Mule applications and their Maven builds
- Study guide: https://www.certifyforce.com/study-guide/mulesoft-developer-ii

**Official exam objective:**

> Build custom API policies.

## What the exam expects

- Place policy logic, configuration and packaging metadata in the right artifacts.
- Trace source and operation policies through normal and error paths.
- Distinguish message propagation, variable scope and dependency visibility.
- Publish and apply custom policies through the appropriate workflow.

A **template** contains executable Mule configuration; a **policy definition** describes configurable behaviour; **source** and **operation** blocks intercept different boundaries; **execute-next** continues processing; **Handlebars** substitutes policy inputs. This lesson uses the Mule 4 policy model present in the February 2024 primary sources ([Baseline reference](https://raw.githubusercontent.com/mulesoft/docs-gateway/e2b1e79085235d8963c0c5a0e390a9456b2a6f03/mule-gateway/modules/ROOT/pages/policies-custom-mule-4-reference.adoc), [Baseline publication](https://raw.githubusercontent.com/mulesoft/docs-gateway/e2b1e79085235d8963c0c5a0e390a9456b2a6f03/mule-gateway/modules/ROOT/pages/policies-custom-mule-getting-started.adoc)).

## Key facts

| Fact | Detail | Source |
|---|---|---|
| Runtime logic | Policy processors live in `template.xml`. | [Workflow](https://docs.mulesoft.com/mule-gateway/policies-custom-getting-started) |
| Continuation | `execute-next` continues the intercepted processing chain. | [Reference](https://docs.mulesoft.com/mule-gateway/policies-custom-mule-4-reference) |
| Variables | Policy-local values stay within that policy's blocks. | [Scope](https://docs.mulesoft.com/mule-gateway/policies-custom-mule-4-reference) |
| Propagation | Source input message changes need explicit forwarding when required. | [Propagation](https://docs.mulesoft.com/mule-gateway/policies-custom-mule-4-reference) |
| Blocked response | Set Response supplies the complete response when execution stops. | [Transform](https://docs.mulesoft.com/mule-gateway/policies-custom-http-transform) |
| Java metadata | `supportedJavaVersions` declares supported Java versions. | [Compatibility](https://docs.mulesoft.com/mule-gateway/policies-custom-mule-4-reference) |
| Exchange lifecycle | Stabilize the definition asset before attaching implementation files. | [Publication](https://docs.mulesoft.com/mule-gateway/policies-custom-mule-getting-started) |
| UI input range | Integer input bounds use `minimumValue` and `maximumValue`. | [Types](https://raw.githubusercontent.com/mulesoft/docs-gateway/e2b1e79085235d8963c0c5a0e390a9456b2a6f03/mule-gateway/modules/ROOT/pages/policies-custom-mule-4-reference.adoc) |

## Check yourself

- Why does declaring a policy input as an integer leave a range-design decision?
- When a policy input must permit multiple values, which metadata attribute controls that capability?
- Must a team's policy category match one of the reference's example names?

## Sources

- [Custom Policy Development Reference](https://docs.mulesoft.com/mule-gateway/policies-custom-mule-4-reference)
- [HTTP Policy Transform Extension](https://docs.mulesoft.com/mule-gateway/policies-custom-http-transform)
- [Mule 4 Custom Policy Workflow](https://docs.mulesoft.com/mule-gateway/policies-custom-getting-started)
- [Uploading a Custom Policy to Exchange](https://docs.mulesoft.com/mule-gateway/policies-custom-upload-to-exchange)
- [Applying Offline Custom Policies](https://docs.mulesoft.com/mule-gateway/policies-custom-offline-apply)
- [Publish a Mule 4 Custom Policy](https://docs.mulesoft.com/mule-gateway/policies-custom-mule-getting-started)
- [Mule 4 policy reference, February 2024 source](https://raw.githubusercontent.com/mulesoft/docs-gateway/e2b1e79085235d8963c0c5a0e390a9456b2a6f03/mule-gateway/modules/ROOT/pages/policies-custom-mule-4-reference.adoc)
- [Mule 4 policy publication, February 2024 source](https://raw.githubusercontent.com/mulesoft/docs-gateway/e2b1e79085235d8963c0c5a0e390a9456b2a6f03/mule-gateway/modules/ROOT/pages/policies-custom-mule-getting-started.adoc)

## About the full unit

The "Core concepts", "Exam traps" and "Worked scenario" sections of this unit, its 13 linked practice questions, and unlimited timed mock exams are included with the MuleSoft Developer II pack (USD $19): https://www.certifyforce.com/practice-exams
