CREATE FEATURE POLICY¶
Creates a new feature policy. Feature policies can be applied to all native apps or all personal databases in an account, or to a specific application. For an overview, see Feature policies.
Syntax¶
Parameters¶
nameSpecifies the identifier for the feature policy.
In addition, the identifier must start with an alphabetic character and cannot contain spaces or special characters unless the entire identifier string is enclosed in double quotes (for example,
"My object"). Identifiers enclosed in double quotes are also case-sensitive.For more information, see Identifier requirements.
BLOCKED_OBJECT_TYPES_FOR_CREATION = ( type [ , ... ] )Specifies a list of objects that can’t be created. The following objects can be blocked:
- AGENTS
- APPLICATION_SERVICE
- ARTIFACT_REPOSITORY
- COMPUTE_POOLS
- DATABASES
- GIT_REPOSITORY
- MCP_SERVERS
- SCHEMA
- SECRET
- TASKS
- WAREHOUSES
- WORKSPACE
Note
Account-level object types have no effect when a feature policy is bound to personal databases. They apply only in a native app context.
APPLICATION_SERVICEandARTIFACT_REPOSITORYare used with Snowflake App Runtime. Attach a policy that blocks these types to all personal databases to prevent users from creating App Runtime apps in their personal databases. For details, see Restrict app creation in personal databases.COMMENT = 'string_literal'String (literal) that specifies a comment for the feature policy.
Default: No value
Access control requirements¶
A role used to execute this operation must have the following privileges at a minimum:
| Privilege | Object | Notes |
|---|---|---|
| CREATE FEATURE POLICY | SCHEMA | Grants the ability to create feature policies. You must have this privilege set on the schema containing the policy to be created. |
Operating on an object in a schema requires at least one privilege on the parent database and at least one privilege on the parent schema.
For instructions on creating a custom role with a specified set of privileges, see Creating custom roles.
For general information about roles and privilege grants for performing SQL actions on securable objects, see Overview of Access Control.
Usage notes¶
- If a policy is bound to an object, for example an account or an app, the policy cannot be replaced. Use the ALTER FEATURE POLICY to update or rename the feature policy.
- This command does not support using the CLONE clause to create a copy of a feature policy.
Examples¶
The following example creates a new feature policy that prohibits an app from creating a database:
The following example creates a new feature policy, but doesn’t specify any objects to prohibit.
Note
This syntax would typically be applied to an app to lift any restrictions that were applied at the account level.