Prerequisites
- Confluent Cloud: an environment with at least one Kafka cluster, and permission to create API keys, ideally for a service account.
- Self-hosted Kafka: a broker whose bootstrap address CloudThinker can reach over the network, port
9092by default. The file has no settings for SASL/SCRAM, mTLS, client certificates, or a custom CA, so the broker must accept CloudThinker’s connection without them. Don’t open such a broker to the internet: restrict it to CloudThinker’s egress IPs. These docs don’t publish CloudThinker’s egress IP list: ask your CloudThinker contact, or contact us. See Reaching private services for other options. - A text editor to write the JSON file.
- The Admin role in your CloudThinker workspace, which can add and edit connections. See Roles.
Choose your scopes
On Confluent Cloud, each API key pair unlocks one scope. Start with the Kafka cluster scope and add others later by uploading an updated file. On self-hosted Kafka, onlyBOOTSTRAP_SERVERS and an optional SCHEMA_REGISTRY_ENDPOINT apply, and every other scope is Confluent Cloud only.
Setup
- Confluent Cloud
- Self-hosted Kafka
1
Collect the cluster fields
In Confluent Cloud, open Environments and select your environment. Its ID (
env-...) is your KAFKA_ENV_ID. Open the cluster and copy its bootstrap server, REST endpoint, and cluster ID (lkc-...).2
Create one API key pair per scope
Go to Settings → API keys and click Add API key. Choose a Service account for production. Create a Kafka cluster key first, then one key for each optional scope you chose. Save each key and secret as you create it. Pick the resource that matches each scope:
3
Collect optional scope fields
- Schema Registry: in the environment, open Stream Governance → Schema Registry and copy the endpoint.
- Flink: open Flink → Compute pools, select the pool, and copy its ID (
lfcp-...). The REST endpoint follows the patternhttps://flink.<region>.<provider>.confluent.cloud, such ashttps://flink.us-east-1.aws.confluent.cloud.FLINK_ENV_IDis theenv-...ID of the environment that holds the pool, usually the same value asKAFKA_ENV_ID. The organization ID is under Settings → Organizations. - Optional Flink defaults:
FLINK_ENV_NAMEis the environment’s display name, used as the default catalog.FLINK_DATABASE_NAMEis the Kafka cluster’s display name, used as the default database. Set them so agents can name tables without the fullcatalog.database.tablepath.
4
Write the JSON file
Save a file such as
kafka.json. Keep only the scopes you created keys for, and delete the other lines entirely:5
Upload the file in CloudThinker
Open More → Workspace settings → Connections and select Apache Kafka. Drag the file into the upload area, or click choose a JSON file. Click Connect.Success state: the connection shows a Connected status. Run the verify prompt below to confirm agents can see your topics.
Connection details
The form has one upload field. The file must be one JSON object with string values, using only the keys listed in Choose your scopes. A file with any other key, or a value that isn’t a string, is rejected.Required permissions
Confluent Cloud: create keys for a service account, and give that account only what agents need.-
Kafka cluster: restrict ACLs to the topics agents should read. Message sampling reads through a consumer group, so the account also needs
READon consumer groups: - Cloud resource management: at least MetricsViewer for metrics.
- Schema Registry: DeveloperRead on the subjects agents should list.
- Flink: FlinkDeveloper in the environment that holds the compute pool.
Agent capabilities
Calls marked Yes go through your workspace Approvals first.
Every change an agent makes goes through your workspace’s Approvals first. On the default Auto · Rules + AI · Ask me mode, AI judgment can let a safe change run without asking — and an Allow Rule can too, once CloudThinker turns on Rule enforcement for your workspace. Choose Manual to approve every change yourself.
Partition counts can’t be changed through a topic config. Use the Confluent Cloud UI, or delete and recreate the topic.
Verify the connection
Example prompts
Change the file later
To add a scope or rotate a key, write a complete file with every scope you want to keep. Open the connection, click the pencil icon on its row, and in Edit Instance click Replace…. Upload the file and click Save and test. If the test fails, CloudThinker keeps the previous credentials. See Rotate a credential.Troubleshooting
Connection refused or timeout
Connection refused or timeout
The broker isn’t reachable from CloudThinker. Check that the broker is running, that
9092 is open in your firewall, and that BOOTSTRAP_SERVERS is correct. A broker bound only to 127.0.0.1 can’t be reached from outside its host.Validation errors after uploading a partial file
Validation errors after uploading a partial file
A scope key is present with an empty value. Delete the whole key and value for any scope you don’t use.
"SCHEMA_REGISTRY_ENDPOINT": "" fails, while leaving the key out works.Metrics or billing questions fail
Metrics or billing questions fail
The file has no
CONFLUENT_CLOUD_API_KEY pair, or its account lacks MetricsViewer. Add the cloud scope and upload the file again. On a self-hosted cluster, these APIs aren’t available.Schema Registry fails
Schema Registry fails
Check that
SCHEMA_REGISTRY_ENDPOINT is reachable from CloudThinker. For self-hosted, open port 8081. For Confluent Cloud, confirm the Schema Registry key belongs to the same environment.Security
- Least privilege — grant only the permissions the agents need for your use case; start read-only and widen later.
- Read-only by default — use read-only credentials unless you want agents to make changes through this connection.
- Rotate credentials — rotate keys and tokens on your normal schedule; CloudThinker picks up the new value when you update the connection.
- Revoke on offboarding — remove the credential at the provider when you delete a connection or a teammate leaves.
- Self-hosted Kafka takes no credentials: the read-only advice above applies only to Confluent Cloud keys. A self-hosted broker accepts whatever its own configuration allows, so limit network access as below, and remember that produce and create calls still go through Approvals.
- One key pair per scope: give each scope its own key on a service account, so you can revoke Flink or Tableflow access without touching the Kafka cluster key.
- Restrict network access: limit the bootstrap and REST endpoints to CloudThinker’s traffic with firewall rules, especially for a self-hosted broker with no credentials.
- Delete the local file: the JSON file holds every secret in plain text. Delete it after you upload it, or keep it only in a secrets manager.
- Treat messages as sensitive: sampled messages can carry personal data or tokens your producers wrote. Grant topic
READonly where agents should look.
Related
Approvals
Decide which Kafka changes run, wait for a person, or are refused.
RabbitMQ connection
Connect another message broker.