Skip to content

Conversation

@bokelley
Copy link
Contributor

Summary

Implements a three-tier brand manifest policy system based on the updated AdCP schema where brand_manifest is now optional in get-products-request.

This allows tenants to control how they want to handle product discovery requests:

  • Public access for maximum discoverability
  • Authentication-only for generic inquiries
  • Brand manifest required for targeted, qualified requests (default)

Policy Options

Policy Auth Required Brand Manifest Required Pricing Shown Use Case
public ❌ No ❌ No ❌ No Maximum product visibility, encourages signup for pricing
require_auth ✅ Yes ❌ No ✅ Yes Allow generic queries from authenticated buyers
require_brand ✅ Yes ✅ Yes ✅ Yes Strictest - only targeted, qualified inquiries (default)

Changes

Database

  • Migration: New brand_manifest_policy column in tenants table
  • Model: Added field with SQLAlchemy 2.0 style annotations
  • Default: require_brand (preserves existing strict behavior)

Business Logic (src/core/tools/products.py)

  • Policy enforcement at request validation level
  • Pricing visibility rules based on policy + authentication + brand_manifest presence
  • Falls back to generic offering text when brand_manifest not provided
  • Clear error messages for policy violations

Admin UI

  • Brand manifest policy dropdown in both policy settings templates
  • Clear descriptions explaining each policy option
  • Located in "Policies & Workflows" section

Tests

  • ✅ 8 comprehensive unit tests covering all three policy modes
  • ✅ Tests authentication enforcement
  • ✅ Tests brand_manifest requirements
  • ✅ Tests pricing visibility rules
  • ✅ All unit tests pass (863 passed, 52 skipped)

Schema Updates

  • Updated AdCP schemas to v1 with optional brand_manifest
  • Refreshed schema metadata files

Test Plan

Manual Testing

  1. Public Policy:

    • Unauthenticated users can see products
    • No pricing shown (even to authenticated users)
    • Encourages authentication for pricing
  2. Require Auth Policy:

    • Unauthenticated users rejected with clear error
    • Authenticated users can query without brand_manifest
    • Pricing shown to authenticated users
  3. Require Brand Policy (default):

    • Unauthenticated users rejected
    • Authenticated users without brand_manifest rejected
    • Full pricing shown when both auth + brand_manifest provided

Automated Tests

  • ✅ All 8 brand manifest policy tests passing
  • ✅ No regressions in existing test suite (863 passed)

Backward Compatibility

  • Default policy is require_brand - existing tenants maintain strict behavior
  • ✅ No breaking changes to API or database schema
  • ✅ Existing tests continue to pass

Migration Notes

The migration adds the brand_manifest_policy column with:

  • Server default: 'require_brand'
  • Nullable: false
  • Existing tenants automatically get the strictest policy

Screenshots

Admin UI screenshots showing the new brand manifest policy dropdown in policy settings would go here.


🤖 Generated with Claude Code

bokelley and others added 2 commits October 28, 2025 20:00
Implements three-tier brand manifest policy system based on updated AdCP schema
where brand_manifest is now optional in get-products-request.

**Policy Options:**
- `public`: Products visible to anyone, no auth required, no pricing shown
- `require_auth`: Auth required, brand_manifest optional, pricing shown to authenticated users
- `require_brand`: Auth + brand_manifest required (strictest, default for backward compatibility)

**Changes:**
- Database: New `brand_manifest_policy` column in tenants table with migration
- Model: Added field to Tenant model with SQLAlchemy 2.0 style annotations
- Business Logic: Policy enforcement in get_products with pricing visibility rules
- Admin UI: Brand manifest policy dropdown in policy settings (both templates)
- Tests: Comprehensive unit tests for all three policy modes (8 tests, all passing)
- Schema: Updated AdCP schemas to v1 with optional brand_manifest

**Behavior:**
- Default policy is `require_brand` (preserves existing behavior)
- Pricing visibility depends on policy + authentication + brand_manifest presence
- Generic offering text used when brand_manifest not provided
- Policy validated with clear error messages

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Implements a two-tier product catalog access control system allowing publishers
to choose between authenticated buyers or public access to their ad products.

Changes:
- Add brand_manifest_policy column to tenants table (default: require_auth)
- Create migration to change default from require_brand to require_auth
- Implement policy enforcement in get_products endpoint
- Add simplified UI with 2 options (authenticated buyers vs public access)
- Update admin UI templates with clean, minimal wording
- Add OAuth redirect URI configuration for local development
- Maps both require_auth and require_brand to same "authenticated" option

Technical details:
- Three backend values: require_auth, require_brand, public
- Two UI options: "Authenticated buyers only" and "Public access"
- Default behavior: require_auth (standard B2B - signup to see pricing)
- Public mode: Products visible without auth, but no pricing shown
- All tests passing (8 unit tests for policy enforcement)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@bokelley bokelley merged commit 1c00e1d into main Oct 29, 2025
9 checks passed
bokelley added a commit that referenced this pull request Nov 10, 2025
The brand_manifest_policy system (added in PR #663) allows per-tenant
configuration of when brand_manifest is required:

- require_auth: Auth required, brand_manifest optional (default)
- require_brand: Auth + brand_manifest required (strictest)
- public: No auth required (no pricing shown)

This commit adds:
- Documentation explaining the three policy options
- Python script to update all tenants to require_auth
- Instructions for updating via Admin UI, SQL, or Fly.io

To make brand_manifest optional for testing, simply set the tenant's
brand_manifest_policy to 'require_auth' instead of 'require_brand'.

Related: PR #663
bokelley added a commit that referenced this pull request Nov 10, 2025
Add UI dropdown in Policies & Workflows section to configure brand_manifest_policy.

The brand_manifest_policy system was added in PR #663 with three options:
- require_auth (default): Auth required, brand_manifest optional
- require_brand: Auth + brand_manifest required (strictest)
- public: No auth required, no pricing shown

This PR adds the missing UI piece so admins can configure the policy:

Changes:
- Added dropdown to tenant_settings.html in Policies & Workflows section
- Added backend handling in settings.py to save the policy value
- Added documentation in docs/brand-manifest-policy.md
- Added script to batch update tenants: scripts/update_brand_manifest_policy.py

Usage:
Admin UI → Tenant Settings → Policies & Workflows → Brand Manifest Policy

Related: PR #663 (original implementation)
bokelley added a commit that referenced this pull request Nov 10, 2025
* docs: Add brand manifest policy configuration docs and update script

The brand_manifest_policy system (added in PR #663) allows per-tenant
configuration of when brand_manifest is required:

- require_auth: Auth required, brand_manifest optional (default)
- require_brand: Auth + brand_manifest required (strictest)
- public: No auth required (no pricing shown)

This commit adds:
- Documentation explaining the three policy options
- Python script to update all tenants to require_auth
- Instructions for updating via Admin UI, SQL, or Fly.io

To make brand_manifest optional for testing, simply set the tenant's
brand_manifest_policy to 'require_auth' instead of 'require_brand'.

Related: PR #663

* feat: Add brand manifest policy UI dropdown in Admin

Add UI dropdown in Policies & Workflows section to configure brand_manifest_policy.

The brand_manifest_policy system was added in PR #663 with three options:
- require_auth (default): Auth required, brand_manifest optional
- require_brand: Auth + brand_manifest required (strictest)
- public: No auth required, no pricing shown

This PR adds the missing UI piece so admins can configure the policy:

Changes:
- Added dropdown to tenant_settings.html in Policies & Workflows section
- Added backend handling in settings.py to save the policy value
- Added documentation in docs/brand-manifest-policy.md
- Added script to batch update tenants: scripts/update_brand_manifest_policy.py

Usage:
Admin UI → Tenant Settings → Policies & Workflows → Brand Manifest Policy

Related: PR #663 (original implementation)
danf-newton pushed a commit to Newton-Research-Inc/salesagent that referenced this pull request Nov 24, 2025
…adcontextprotocol#663)

* feat: Add brand manifest policy system for flexible product discovery

Implements three-tier brand manifest policy system based on updated AdCP schema
where brand_manifest is now optional in get-products-request.

**Policy Options:**
- `public`: Products visible to anyone, no auth required, no pricing shown
- `require_auth`: Auth required, brand_manifest optional, pricing shown to authenticated users
- `require_brand`: Auth + brand_manifest required (strictest, default for backward compatibility)

**Changes:**
- Database: New `brand_manifest_policy` column in tenants table with migration
- Model: Added field to Tenant model with SQLAlchemy 2.0 style annotations
- Business Logic: Policy enforcement in get_products with pricing visibility rules
- Admin UI: Brand manifest policy dropdown in policy settings (both templates)
- Tests: Comprehensive unit tests for all three policy modes (8 tests, all passing)
- Schema: Updated AdCP schemas to v1 with optional brand_manifest

**Behavior:**
- Default policy is `require_brand` (preserves existing behavior)
- Pricing visibility depends on policy + authentication + brand_manifest presence
- Generic offering text used when brand_manifest not provided
- Policy validated with clear error messages

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

* feat: Add simplified brand manifest policy system for product discovery

Implements a two-tier product catalog access control system allowing publishers
to choose between authenticated buyers or public access to their ad products.

Changes:
- Add brand_manifest_policy column to tenants table (default: require_auth)
- Create migration to change default from require_brand to require_auth
- Implement policy enforcement in get_products endpoint
- Add simplified UI with 2 options (authenticated buyers vs public access)
- Update admin UI templates with clean, minimal wording
- Add OAuth redirect URI configuration for local development
- Maps both require_auth and require_brand to same "authenticated" option

Technical details:
- Three backend values: require_auth, require_brand, public
- Two UI options: "Authenticated buyers only" and "Public access"
- Default behavior: require_auth (standard B2B - signup to see pricing)
- Public mode: Products visible without auth, but no pricing shown
- All tests passing (8 unit tests for policy enforcement)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

---------

Co-authored-by: Claude <noreply@anthropic.com>
danf-newton pushed a commit to Newton-Research-Inc/salesagent that referenced this pull request Nov 24, 2025
…ol#726)

* docs: Add brand manifest policy configuration docs and update script

The brand_manifest_policy system (added in PR adcontextprotocol#663) allows per-tenant
configuration of when brand_manifest is required:

- require_auth: Auth required, brand_manifest optional (default)
- require_brand: Auth + brand_manifest required (strictest)
- public: No auth required (no pricing shown)

This commit adds:
- Documentation explaining the three policy options
- Python script to update all tenants to require_auth
- Instructions for updating via Admin UI, SQL, or Fly.io

To make brand_manifest optional for testing, simply set the tenant's
brand_manifest_policy to 'require_auth' instead of 'require_brand'.

Related: PR adcontextprotocol#663

* feat: Add brand manifest policy UI dropdown in Admin

Add UI dropdown in Policies & Workflows section to configure brand_manifest_policy.

The brand_manifest_policy system was added in PR adcontextprotocol#663 with three options:
- require_auth (default): Auth required, brand_manifest optional
- require_brand: Auth + brand_manifest required (strictest)
- public: No auth required, no pricing shown

This PR adds the missing UI piece so admins can configure the policy:

Changes:
- Added dropdown to tenant_settings.html in Policies & Workflows section
- Added backend handling in settings.py to save the policy value
- Added documentation in docs/brand-manifest-policy.md
- Added script to batch update tenants: scripts/update_brand_manifest_policy.py

Usage:
Admin UI → Tenant Settings → Policies & Workflows → Brand Manifest Policy

Related: PR adcontextprotocol#663 (original implementation)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants