> For the complete documentation index, see [llms.txt](https://docs.cipp.app/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.cipp.app/user-documentation/tools/templatelib.md).

# Template Library

A template library keeps CIPP's stored templates in step with an external source. Point it at one of your tenants and CIPP copies that tenant's live policies into templates on a schedule, so you always hold a current copy. Point it at a community repository and CIPP pulls the templates published there whenever new versions are released.

Tenant-based libraries sync every 4 hours. Community repository libraries sync every 7 days.

{% hint style="warning" %}
Enabling this feature will overwrite templates with the same name.
{% endhint %}

## Choosing a Source

A library draws from either a tenant or a community repository, not both. Select one or the other from the two fields at the top of the page.

### Tenant

Choose a tenant to use as the source. CIPP reads its live policies and turns each one into a template.

{% hint style="success" %}
CIPP recommends using a Customer Development Experience tenant for developing your templates. See Microsoft's [CDX documentation](https://cdx.transform.microsoft.com/) for more information.
{% endhint %}

### Community Repository

Choose a repository registered with your instance. Once selected, a **Repository Branch** field appears, prefilled with the repository's default branch and changeable if the templates you want live elsewhere.

Repositories are managed separately, and you can register your own alongside the built-in ones:

CIPP ships with five repositories registered:

| Repository                                                                         | Contents                                                                                        |
| ---------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- |
| [CIPP Templates](https://github.com/CyberDrain/CIPP-Templates)                     | CyberDrain's own repository, covering standards, groups, policies, Conditional Access and more. |
| [CyberDrain CIS Templates](https://github.com/CyberDrain/CyberDrain-CIS-Templates) | Intune templates aligned to CIS benchmarks.                                                     |
| [Open Intune Baseline](https://github.com/SkipToTheEndpoint/OpenIntuneBaseline)    | A widely used Intune device baseline applying multiple frameworks including CIS and NIS.        |
| [Conditional Access Baseline](https://github.com/j0eyv/ConditionalAccessBaseline)  | A ready-made framework of Conditional Access templates.                                         |
| [Intune Baselines](https://github.com/IntuneAdmin/IntuneBaselines)                 | A further set of Intune baseline templates.                                                     |

{% hint style="info" %}
A repository-based library imports every template file the selected branch contains. The template type switches below apply to tenant-based libraries.
{% endhint %}

## Template Types

Which switches appear depends on the source selected.

For a tenant, choose the policy types to copy:

| Setting                               | Description                                                                                     |
| ------------------------------------- | ----------------------------------------------------------------------------------------------- |
| Create Conditional Access Templates   | Copies the tenant's Conditional Access policies, resolving the users and groups they reference. |
| Create Intune Configuration Templates | Copies the tenant's device configuration profiles.                                              |
| Create Intune Compliance Templates    | Copies the tenant's compliance policies.                                                        |
| Create Intune Protection Templates    | Copies the tenant's app protection policies.                                                    |

For the CyberDrain CIPP Templates repository, a different set is offered covering the template kinds that repository publishes:

| Setting                   | Description                   |
| ------------------------- | ----------------------------- |
| Create Template Standards | Standards templates.          |
| Create Group Templates    | Group templates.              |
| Create Policy Templates   | Policy templates.             |
| Create CA Templates       | Conditional Access templates. |

## Setting Up a Template Library

{% stepper %}
{% step %}

### Select a tenant or a community repository

Choose the source the templates will come from. Selecting a repository also lets you pick a branch.
{% endstep %}

{% step %}

### Select template types

Toggle on the template types you would like copied.
{% endstep %}

{% step %}

### Submit

Saving creates a scheduled task named after the tenant or repository, which performs the sync from then on. A tenant already has a library where the name is rejected as a duplicate, so each source can only have one.
{% endstep %}
{% endstepper %}

{% hint style="info" %}
Templates are compared before being written. Where a template already exists, carries the same source, and its content is unchanged, CIPP skips it rather than rewriting it, so a sync that reports no changes is working correctly.
{% endhint %}

***

## Feature Requests / Ideas

We value your feedback and ideas. Please raise any [feature requests](https://github.com/CyberDrain/CIPP/issues/new?template=feature.yml) on GitHub.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.cipp.app/user-documentation/tools/templatelib.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
