Security & Permissions

Security, UK Data Residency & HubSpot Permissions

DealFooting is built for commercial contracts and CRM governance. This page documents our exact implemented controls, what is stored vs. discarded, which HubSpot scopes we request, and what is still qualified before production customer PDFs.

Data Lifecycle: Three Distinct Layers

We keep raw PDF bytes out of persistent storage and separate short-lived review previews from compact duplicate-protection receipts.

Data Category What It Contains How Long It Lives What We Never Store
1. Raw PDF Bytes Binary PDF downloaded from the Deal attachment you select (max 4.5 MB live). In memory only. Mutable binary buffers are zero-filled (finally cleanup) on success, error, timeout, or abort. Immutable V8 runtime strings are reclaimed by normal Node.js garbage collection when the request ends. Never written to SQLite, disk, error payloads, or logs.
2. Structured Previews Extracted counterparty name, dates, line descriptions, totals, and short source excerpts (zero raw PDF bytes). 30 minutes max. Purged automatically every 60 seconds by background sweep and immediately on server startup. No raw PDF binaries, no payment cards.
3. Commit Audit Receipt Filename, one-way SHA-256 hash, HubSpot Deal & line-item IDs, grand total, currency, footing verdict, any reviewer override cause/note, renewal task outcome. Retained while portal is active to prevent duplicate writes on retries and maintain your review trail. Deleted on full portal erasure request. No unrelated HubSpot Contacts, Companies, or full PDF text.
Backup Honesty Disclosure: Deleted previews and erased portal metadata may persist inside encrypted host volume snapshots until the hosting provider's rolling backup window expires. Backups are never used to re-populate active previews. Exact hosting volume region and verified backup window are published and shared with pilot admins prior to live production onboarding.

UK London Processing Architecture & Honest Qualification Status

Configured Architecture

DealFooting's backend enforces eu-west-2 (London) for Amazon Bedrock extraction, rejects cross-region inference profile prefixes (us., eu., apac., global.) and retired model IDs in code, and sends documents under a neutral filename (contract-document) so customer filenames are not transmitted to inference metadata. API and metadata storage are architected for UK London hosting.

Pre-Production Evidence Gate (No Overclaims)

Software guards prevent misconfiguration, while AWS account-level Zero Data Retention (none), disabled Model Invocation Logging on the production role, and hosting volume/backup regions require dated operator readbacks. During closed-beta onboarding, we complete and share that dated verification summary and DPA pack before accepting live customer PDFs.

Prompt-Injection Defense & Deterministic Verification

  • In-Memory Inspection Before Extraction: Every PDF passes header validation (%PDF-), encryption checks, strict byte ceilings (4,500,000 bytes live), bounded text extraction, and prompt-injection pattern scanning before AI extraction.
  • Calm Security Hold (No Override): When hidden instructions or adversarial overrides are detected (e.g., hidden white-on-white text trying to alter a total), DealFooting places a permanent Security hold, locks automated writing to HubSpot with no override path, and directs the reviewer to inspect the original signed PDF.
  • Independent Source-Total Check: Even after AI extraction, deterministic code verifies every row's arithmetic in integer pence/cents AND independently checks the extracted grand total against the PDF's text layer.
  • Signed Requests & Encrypted Tokens: Every HubSpot card request validates X-HubSpot-Signature-v3 (5-minute window), verifies the signed user holds an active portal access grant, and confirms the selected file belongs to that Deal. HubSpot OAuth tokens are encrypted at rest with AES-256-GCM and protected against token-refresh resurrection by monotonic installation generation fencing.

Exact HubSpot OAuth Permissions (6 Required + 2 Optional)

DealFooting uses HubSpot authorisation to open the selected Deal, load its PDF attachment, and read existing line items. With your approval, it can add line items and update opt-in Deal fields, which is why write permissions for Deals and line items are required. Product Library read access adds SKU matching. Task write access lets you choose to create renewal reminders. Both are optional, and an administrator sees the full permission list before connecting.

Required Scopes (6 exact scopes — zero legacy e-commerce)

HubSpot Scope Why It Is Required
oauth Authenticates and connects your HubSpot portal.
crm.objects.deals.read Reads the active Deal's name, currency, stage, and attached Notes/files.
crm.objects.deals.write Updates Deal amount or optional custom renewal properties only when you explicitly toggle them on at approval.
crm.objects.line_items.read Reads existing Deal line items before syncing.
crm.objects.line_items.write Creates approved line items and associates them with the Deal.
files Downloads the single PDF attachment you select on an authorised Deal. (Note: HubSpot grants file-read scope at app level; DealFooting enforces deal-attachment membership in code so it only fetches the exact file attached to the authorised Deal you choose.)

Optional Scopes (2 exact scopes — gracefully degraded)

Optional Scope Capability & Graceful Fallback
crm.objects.products.read Matches extracted rows to your HubSpot Product Library SKUs. If omitted, DealFooting clearly reports the missing scope and syncs verified rows as custom line items.
crm.objects.tasks.write Creates an opt-in Renewal Reminder Task associated with the Deal. If omitted, Renewal Radar still displays deadlines and the commit receipt explicitly flags that task creation was skipped.

Exact HubSpot Fields Approval Can Change

  • Line Items (always created when approved): description/name, quantity, unit price, unit-period discount, billing frequency, term months, optional HubSpot Product Library link, and verification stamp.
  • Deal Amount (amount): Opt-in (off by default). Automatically disabled when contract TCV is withheld (partial sync, open-ended term, milestone invoice, pass-through disbursements, or unresolved math discrepancy).
  • Custom Deal Renewal Properties (dealfooting_*): Opt-in (off by default). Pre-checked before commit so fresh portals without custom properties never fail mid-write.
  • Associated Deal Task: Opt-in (off by default). Requires crm.objects.tasks.write.

Disconnect, Uninstall & Data Deletion (Honest Lifecycle)

  • App-Initiated Disconnect: Disconnect calls HubSpot's DELETE /appinstalls/v3/external-install. Upon HubSpot confirmation (204), encrypted OAuth tokens and active previews are deleted immediately. If HubSpot returns an error or times out, DealFooting holds the installation in pending_remote_uninstall so removal can retry cleanly rather than reporting false success.
  • Uninstalling Inside HubSpot Settings: If an admin removes DealFooting directly inside HubSpot settings rather than via the app disconnect action, we do not claim zero-second automatic purge until live HubSpot app-lifecycle event delivery is verified end-to-end. Email privacy@dealfooting.com with your HubSpot Portal ID to confirm immediate token removal.
  • Full Portal Erasure: Email privacy@dealfooting.com with your HubSpot Portal ID to delete remaining commit receipts, access grants, and entitlement records. Requests are completed within 72 hours (well inside UK GDPR's 30-day statutory window).
  • CRM Records Untouched: Disconnecting or uninstalling DealFooting never deletes Deals, Line Items, or Tasks already written into your HubSpot CRM.