---
schema_version: "1"
id: 0ace80c448e589931a3d811d8e593213a07ab4e01f186106b5f092f810b97983
title: Policy Development Kit Architecture Overview
collection: mulesoft
version: current
locale: en-us
portal_url: https://docs.salesforce.com/mulesoft/current/en-us/pdk/1.7/policies-pdk-architecture.md
canonical_url: https://docs.mulesoft.com/pdk/1.7/policies-pdk-architecture
source_site: docs.mulesoft.com
content_type: documentation
content_hash: 7778e09e8d1b5394ea53bc66fa2905d1977075c46875e1b5e096d53944b164cf
description: MuleSoft Documentation Site
release: "1.7"
latest: false
---
---
product: Omni Gateway Policy Development Kit (PDK)
version: 1.7
---

# Policy Development Kit Architecture Overview

> For the full documentation index, see: https://docs.mulesoft.com/llms.txt

Flex Gateway Policy Development Kit (PDK) consists of:

- [Anypoint CLI PDK Plugin](#anypoint-cli-pdk-plugin): Generates and distributes the policy to
  Exchange

- [Policy Template](#policy-template): Scaffolds new custom policies

- [SDK Building Tools](#sdk-building-tools): Simplifies the development process

## Anypoint CLI PDK Plugin

The Anypoint CLI PDK plugin creates the PDK project and uploads policy assets to Exchange (for
Connected Mode only). After creating the project, PDK provides a simplified set of commands in a
`Makefile` to complete all following development steps.

## Policy Template

PDK generates some simple scaffolding when creating the policy.

All generated files contain the required information to properly compile the policy.

For more information about the included files, see
[Project Structure](https://docs.mulesoft.com/pdk/1.7/policies-pdk-create-project#project-structure).

## SDK Building Tools

Flex Gateway is built on Envoy which requires developed policies to be compatible with the
event-driven [proxy-wasm](https://github.com/proxy-wasm/spec) architecture.

\`proxy-wasm’s event-driven architecture requires users to manage the different events that handle a
single request. This causes the following drawbacks that make developing and maintaining
event-driven code costly:

- High complexity of the code due to the coupling of business logic with the entry points

- Inability to modularize common logic which creates monolithic code

- Verbose non-linear control flow that creates difficult function callbacks and error propagation

PDK provides building tools that abstract the developer from the event-oriented coding approach by
using reactor and executor patterns. PDK provides the developer a way to code each incoming request
in a linear method that results in:

- Fewer compile and runtime errors from using methods in the incorrect context

- Reduced learning curve

- Improved debugging by minimizing call stacks

- Reduced code duplication

- Improved parameter injection

- Reduced use of dynamic memory that decreases indeterminism and the need for custom memory
  management

## MCP Policy Management

The Mulesoft MCP Server provides `manage_flex_gateway_policy_project` and
`get_flex_gateway_policy_example` tools to manage the custom policy lifecycle.

To learn more, see
[MuleSoft MCP Server Policy Management Tools](https://docs.mulesoft.com/mulesoft-mcp-server/reference-mcp-tools#policy-management).

## See Also

- [Prerequisites for Flex Gateway Policy Development Kit (PDK)](https://docs.mulesoft.com/pdk/1.7/policies-pdk-prerequisites)
