SecureTemplates are a family of protected frame and button templates defined as part of FrameXML. Through attribute-based configuration, they allow addons to access some of the protected functionality. The templates are defined in FrameXML/SecureTemplates.xml, and functionality supporting them resides in FrameXML/SecureTemplates.lua
Suppose we wanted to create a button that, when clicked, would cast [Mark of the Wild] on the player. This can be solved by inheriting from SecureActionButtonTemplate and setting the relevant attributes. For example, using only XML:
<Ui><Buttonname="MyThornsButton"inherits="SecureActionButtonTemplate"parent="UIParent"><Attributes><Attributename="type"type="string"value="spell"/><Attributename="spell"type="string"value="Mark of the Wild"/><Attributename="unit"type="string"value="player"/></Attributes><Sizex="64"y="64"/><Layers><Layerlevel="OVERLAY"><Texturename="$parentIcon"file="Interface\Icons\Spell_Nature_Regeneration"setAllPoints="true"/></Layer></Layers><Anchors><Anchorpoint="CENTER"/></Anchors></Button></Ui>