Use parameterized views in agentic applications

To securely run parameterized views in Bigtable applications that use AI agents or large language models (LLMs), you must establish strict access control and pass parameters out of band.

Set up access control

Bigtable logical views operate on a definer's rights security model. This means that when you query a view, the query executes with the permissions of the user who defined the view, not the user who is running the query. To enforce the principle of least privilege, grant your application's service account permissions to access only the view, while withholding permissions to the underlying source table.

Follow these steps to set up access control:

  1. Create a dedicated IAM role for your application that has minimal permissions, such as the bigtable.reader role.
  2. Grant this role permissions to the view only. You can use an IAM condition to limit the bigtable.logicalViews.readRows permission to your specific view.
  3. For stricter access control, explicitly deny the application role any permissions on the underlying base table using an IAM deny policy.

For more information, see Bigtable access control with IAM.

Inject a view parameter

In agentic applications, parameter values for the parameterized logical view, such as user credentials or tenant boundaries, must be supplied by your trusted application code, not by the LLM or the end-user. This isolates untrusted user input and model-generated query strings from your database inputs.

To build an AI agent, you can use the Agent Development Kit (ADK) framework. ADK provides the following components that help you integrate parameterized views: