The correct answer is B: By adding the configurations in dbt_project.yml within the package’s namespace.
dbt packages are installed as read-only code, meaning you should never modify files inside /dbt_packages, nor should you attempt to overwrite generated artifacts inside /target. Instead, dbt provides a clean and officially supported method for overriding or extending configurations on models from packages: using the dbt_project.yml file.
Each package comes with its own namespace, and users can override model-level configurations by referencing that namespace inside the models: section of dbt_project.yml. dbt merges project-level configurations with package-level defaults, and configurations defined in dbt_project.yml take precedence. This is the only correct and recommended way to override settings such as materializations, tags, schema, or custom config blocks on models imported through a package.
Option A is incorrect because packages.yml is used only to declare package dependencies—not to configure package models. Option C is incorrect because the ./target folder contains compiled and ephemeral artifacts that should never be edited. Option D is incorrect because modifying code in /dbt_packages violates dbt best practices and will be overwritten each time packages are reinstalled.
Therefore, overriding configurations must be done exclusively through dbt_project.yml.