clerk.create_m2m_token
Create an M2M token in a connected Clerk instance. Sensitive — the returned token is a high-privilege secret; do not log or expose it. Call clerk.get_connected_accounts first. Pass clerk_instance_id to target a specific connection, or omit it to use the default account. Returns the created M2M to...
This record as markdown: /tools/io-github-vee3io-vee3/clerk.create-m2m-token.md
What clerk.create_m2m_token does on Vee3
AI agents use clerk.create_m2m_token to create or update resources in Vee3, usually the action step of a workflow, after the agent has gathered context. Every call changes real data in your Vee3 environment.
| Parameter | Type | Required | Description |
|---|---|---|---|
claims | object | — | Optional custom claims embedded in the token. |
token_format | object | — | Token format: "opaque" (default) or "jwt". |
clerk_instance_id | object | — | Clerk instance id (ins_...) from clerk.get_connected_accounts. Omit to use the default connected account. |
machine_secret_key | string | Yes | Machine secret key (msk_...) used to authenticate the create request. |
seconds_until_expiration | object | — | Token lifetime in seconds. |
min_remaining_ttl_seconds | object | — | For opaque tokens, reuse an existing token with at least this TTL remaining. |
Parameters from the server's own tool schema.
Why clerk.create_m2m_token is rated Medium
Creates authentication credentials enabling machine-to-machine access with elevated privileges to Clerk instance.
From the tool's definition Create an M2M token, high-privilege secret, do not log or expose
Attacks that exploit this kind of access
The rule that runs clerk.create_m2m_token safely
PolicyLayer is an MCP gateway: it sits between your AI agents and Vee3, and checks every tool call against a rule you set before the call runs. Nothing changes on the server itself. For clerk.create_m2m_token, this is the rule to start with:
clerk.create_m2m_token stays usable, but capped: an agent stuck in a loop can't make hundreds of changes a minute. Everything else on the server is denied unless you say otherwise.
The button opens the PolicyLayer dashboard: create your workspace, connect Vee3, apply this rule, and every clerk.create_m2m_token call is checked against it from then on.
Questions about clerk.create_m2m_token
Create an M2M token in a connected Clerk instance. Sensitive — the returned token is a high-privilege secret; do not log or expose it. Call clerk.get_connected_accounts first. Pass clerk_instance_id to target a specific connection, or omit it to use the default account. Returns the created M2M token. Cost = 15 tokens. It is categorised as a Write tool in the Vee3 MCP Server, which means it can create or modify data. Consider rate limits to prevent runaway writes.
clerk.create_m2m_token accepts 6 parameters: claims, token_format, clerk_instance_id, machine_secret_key, seconds_until_expiration, min_remaining_ttl_seconds. Required: machine_secret_key. The full parameter table on this page comes from the server's own tool schema.
Register the Vee3 MCP server in PolicyLayer and add a rule for clerk.create_m2m_token: allow, deny, rate-limit, or require approval. Point your MCP client at the PolicyLayer proxy URL and the rule is enforced on every call, before it reaches Vee3. Nothing to install.
clerk.create_m2m_token is a Write tool with medium risk. Write tools should be rate-limited to prevent accidental bulk modifications.
Yes. Add a rate_limit block to the clerk.create_m2m_token rule in your PolicyLayer policy. For example, setting max: 10 and window: 60 limits the tool to 10 calls per minute. Rate limits are tracked per agent session and reset automatically.
Set action: deny in the PolicyLayer policy for clerk.create_m2m_token. The AI agent will receive a policy violation error and cannot call the tool. You can also include a reason field to explain why the tool is blocked.
clerk.create_m2m_token is provided by the Vee3 MCP server (https://mcp.vee3.io/mcp). PolicyLayer sits as a proxy in front of this server to enforce policies before tool calls reach the server.
More on Vee3, and thousands of servers like it.
This server
Across the catalogue