Skip to content

slack-bot: approval-card blocks fail Slack's schema validation (invalid_blocks) #1986

Closed

Description

@kantord

What happened

Every real permission ask against a --posture strict mecak8s instance's Slack bot fails to deliver its approval card. Slack rejects the message outright:

```
[ERROR] web-api:WebClient:0 failed to match any allowed schemas [json-pointer:/blocks/0/rows/0/1]
[ERROR] web-api:WebClient:0 missing required field: text [json-pointer:/blocks/0/rows/0/1]
[ERROR] web-api:WebClient:0 missing required field: value [json-pointer:/blocks/0/rows/0/1]
[ERROR] web-api:WebClient:0 must be more than 0 characters [json-pointer:/blocks/0/rows/0/1/elements/0/elements/0/text]
[ERROR] web-api:WebClient:0 missing required field: element [json-pointer:/blocks/0/rows/0/1]
[WARN] bolt-app failed to DM a permission-approval card — denying closed WebAPIPlatformError: An API error occurred: invalid_blocks
at async Object.postMessage (/sdk/examples/slack-bot/src/approvals.ts:66:24)
at async PermissionApprovalGateway.#start (/sdk/examples/slack-bot/src/approvals.ts:373:18)
```

Per `approvals.ts`'s own fail-closed design (`#1707`), the ask correctly resolves to `deny` when the card can't be delivered - so this isn't a security gap, but it means the entire DM-approval feature is currently non-functional whenever a real ask fires. Every ask silently denies instead of ever reaching the user.

Where

`sdk/typescript/examples/slack-bot/src/approvals.ts` - whatever builds the Block Kit payload passed to `postMessage` (line 66), specifically the structure at `blocks[0].rows[0][1]` per the schema errors above. That path looks like a rich-text/section block missing a required leaf (empty `text`, no `value`, no `element`) - possibly a tool name or argument string that's empty or undefined for some tool/arg shape, producing a block with an empty text leaf.

Repro

Deploy the Slack bot against a `--posture strict` mecak8s instance with no blanket allow for a mutate-ask-floor tool (or any tool with no explicit rule, which also defaults to `Ask` - see stacklok/infra#5844 for a real case: `Skill` had no explicit `allow`/`deny` in the CLI permission-config, so it defaulted to `Ask`, triggering this path). Trigger any tool call that reaches a real `PermissionAsk`. Confirmed live in staging (`mecak8s-slack-bot-backend`, 2026-09-28).

Impact

The DM-approval feature (`#1707`) cannot currently deliver a single real approval card - it always fails closed instead. Worth prioritizing given it's the core safety mechanism the feature exists for.

Fully or partially written by an AI agent.

Activity

  1. self-assigned this
    on Sep 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions