Skip to content
KT
Back to work

Secure interface · Slack events · Hugging Face

Gradio + Slack AI Bot

A credential-safe Gradio and Slack bot notebook with event handling, Hugging Face text generation, output formatting, and secret-store guidance instead of hard-coded tokens.

Gradio + Slack AI Bot project poster
Project evidence · 2026

Case study brief

The problem, then the product response.

01 · Challenge

A shared generation capability should work in both a direct web interface and team chat without duplicating logic or exposing platform tokens.

02 · Response

I rebuilt the notebook around one reply engine used by Gradio and Slack event handlers, with Hugging Face generation and secrets loaded from the environment or Colab Secrets.

System anatomy

How the system coordinates work.

The architecture is expressed as responsibilities and boundaries so the model, workflow logic, interfaces, and human controls remain inspectable.

01

Gradio provides a direct interface for local text-generation tests

02

Slack event input is validated and mapped to the same generation function

03

Secrets remain outside source code and formatted replies return to the correct channel

Implementation

What I built and the decisions behind it.

01

Created a direct Gradio interaction path for local testing.

02

Mapped Slack app mentions and direct messages to the same generation function.

03

Formatted replies for the correct channel and included safe error behavior.

04

Removed embedded live credentials and documented token rotation and secret storage.

Evidence & validation

What an evaluator can inspect.

Credential-safe executed notebook.

Slack event-handling code and Gradio output evidence.

README guidance, screenshot, and professional project post.

Reflection

Sharing a small, testable core function across interfaces improves consistency and makes security corrections easier to apply.

Next iteration

  • Add thread-aware Slack context.
  • Implement request rate limits and moderation.
  • Deploy the generation service independently from the interface adapters.

Outcomes

What the project delivered.

Secure replacement for previously embedded Slack tokens

Executable notebook with Gradio and Slack paths

Documented event handling and professional project evidence

Technology & concepts

01Gradio02Slack03Hugging Face04Python05Secrets