Documentation
How to deploy, configure, use, update, and remove CivicShield AI in your agency's Google Cloud project.
How it works
CivicShield AI runs as a container on Cloud Run in your agency's own Google Cloud project. For each PDF records packet it:
- Reads the text of each page and sends it to Sensitive Data Protection in your project to find PII.
- Permanently removes the matching text from the PDF and covers each area with a black box labeled with the type of information removed, such as
[US_SOCIAL_SECURITY_NUMBER]. - Asks Vertex AI (Gemini) to draft a statutory exemption citation under your state's public records law. Gemini receives only your state's name and the names of the categories found, never document text or personal information.
- Writes a row to the BigQuery audit log in your project and returns the redacted PDF to your browser.
The deployed container doesn't send anything to Novfifteen. The Security page describes the data flow in more detail.
Before you release records
Scanned pages are refused. CivicShield AI finds PII in a PDF's text layer, and a page that is only a scanned image has none. If a packet contains such pages, CivicShield AI stops, redacts nothing, and lists the pages to fix. Run OCR on the file (most PDF tools can add a text layer) and upload it again.
Exemption citations are drafts. CivicShield AI drafts the citation under the state you set when deploying (step 6). Check the statute before release. If no state is set, the draft describes the type of exemption without citing a statute.
Staff review every redaction. Automated detection can miss information, for example a name or number split across two lines. The Terms require qualified staff to review each packet before release.
Plans and limits
- Municipal Starter: one department and one Google Cloud project, for up to 5,000 redacted pages per month. Agencies that need more move to Enterprise.
- Agency & University Enterprise: multiple departments and projects, and custom detection templates.
- Both plans use the same container and the same deployment steps.
- Each upload can be a PDF of up to 32 MB, which is Cloud Run's request size limit. Split larger packets before uploading.
Get access
If you subscribe through Google Cloud Marketplace: on the CivicShield AI listing, choose a plan, then choose Register with Novfifteen LLC. Sign in with the same Google account, and you'll land in the CivicShield AI Console. That's where you give your project access to the image (step 2 below). You can change or cancel your plan in Google Cloud Marketplace at any time.
If you buy directly from Novfifteen: email support@novfifteen.com.
Deploy in your Google Cloud project
Before you begin
- A Google Cloud project with billing enabled, in your agency's Google Cloud organization.
- The Owner role on that project, or admin roles for Cloud Run, IAM, BigQuery, and Identity-Aware Proxy (IAP).
- The Google Cloud CLI, or Cloud Shell in the Google Cloud console.
Run the commands in order in the same terminal session. The examples use the us-central1 region.
1. Set your project and region
export PROJECT_ID=your-project-id
export REGION=us-central1
export SA=foia-redactor-sa@$PROJECT_ID.iam.gserviceaccount.com
export IMAGE_REPO=us-central1-docker.pkg.dev/foia-shield-isv-prod/foia-isv-repo/civicshield-foia
export STATE="Your State" # e.g. Indiana: citations are drafted under this state's law
gcloud config set project $PROJECT_ID
export PROJECT_NUMBER=$(gcloud projects describe $PROJECT_ID --format='value(projectNumber)')
echo $PROJECT_NUMBER
2. Give your project access to the image
Marketplace customers: in the CivicShield AI Console, enter the project number printed above and choose Give access. Direct customers: email the project number to support@novfifteen.com, and we'll confirm when it's done. You can do steps 3 to 5 in the meantime.
3. Enable the required APIs
gcloud services enable \
run.googleapis.com \
dlp.googleapis.com \
aiplatform.googleapis.com \
bigquery.googleapis.com \
iap.googleapis.com
4. Create the audit dataset
CivicShield AI writes its audit log to a dataset named foia_compliance_audit.
bq --location=$REGION mk --dataset \
$PROJECT_ID:foia_compliance_audit
5. Create the service account and grant its roles
gcloud iam service-accounts create foia-redactor-sa \
--display-name="CivicShield AI"
gcloud projects add-iam-policy-binding $PROJECT_ID \
--member=serviceAccount:$SA --role=roles/dlp.user
gcloud projects add-iam-policy-binding $PROJECT_ID \
--member=serviceAccount:$SA --role=roles/aiplatform.user
bq query --use_legacy_sql=false --location=$REGION \
"GRANT \`roles/bigquery.dataEditor\` ON SCHEMA \`$PROJECT_ID.foia_compliance_audit\` TO 'serviceAccount:$SA'"
The last command grants BigQuery Data Editor on the audit dataset only, not the whole project.
6. Deploy CivicShield AI
Run this once your project has image access.
gcloud run deploy civicshield-foia-service \
--image=$IMAGE_REPO:v1 \
--region=$REGION \
--service-account=$SA \
--set-env-vars="PROJECT_ID=$PROJECT_ID,REGION=$REGION,JURISDICTION=$STATE" \
--no-allow-unauthenticated \
--iap \
--min-instances=0 \
--max-instances=2 \
--memory=1Gi \
--timeout=900
The service is private. Nobody can reach it until you give them access in the next section.
Give staff access
CivicShield AI sits behind Identity-Aware Proxy (IAP), so staff sign in with their agency Google accounts. First let IAP reach the service, then add each staff member or group.
gcloud run services add-iam-policy-binding civicshield-foia-service \
--region=$REGION \
--member=serviceAccount:service-$PROJECT_NUMBER@gcp-sa-iap.iam.gserviceaccount.com \
--role=roles/run.invoker
gcloud iap web add-iam-policy-binding \
--member=user:STAFF_EMAIL \
--role=roles/iap.httpsResourceAccessor \
--region=$REGION \
--resource-type=cloud-run \
--service=civicshield-foia-service
Repeat the second command for each person, or use group:GROUP_EMAIL to add a whole group at once. If your project isn't in a Google Cloud organization, or staff use accounts outside it, IAP needs extra setup. See Google's guide to IAP for Cloud Run.
Configure detection
By default, CivicShield AI looks for Social Security numbers, person names, street addresses, phone numbers, email addresses, dates of birth, driver's license numbers, and medical terms.
Enterprise customers can use a custom Sensitive Data Protection inspection template. Give the service account read access to templates, then set the template ID:
gcloud projects add-iam-policy-binding $PROJECT_ID \
--member=serviceAccount:$SA --role=roles/dlp.inspectTemplatesReader
gcloud run services update civicshield-foia-service \
--region=$REGION \
--update-env-vars=DLP_TEMPLATE_ID=YOUR_TEMPLATE_ID
Use CivicShield AI
- Get the service's address:
gcloud run services describe civicshield-foia-service \ --region=$REGION --format='value(status.url)' - Open that address in a browser and sign in with your agency Google account.
- Upload a PDF records packet and click Redact PII & Generate Statutory Audit Log. The redacted file downloads as
REDACTED_followed by the original file name. - Check every page of the redacted PDF and replace the draft citation with your state's exemption (see Before you release records).
Audit log
Each redaction adds one row to foia_compliance_audit.redaction_audit_log in your project, with:
- a job ID and timestamp
- the uploaded file name
- the page count and number of redactions
- the types of information found
- the draft exemption citation
- the state used for the citation, and the CivicShield AI engine version
The log never contains the redacted text itself. It does contain file names, so avoid putting people's names in the names of files you upload. To see recent entries:
bq query --use_legacy_sql=false --location=$REGION \
'SELECT * FROM foia_compliance_audit.redaction_audit_log LIMIT 20'
Project admins can change or delete rows, so control who has access to this dataset, and keep it according to your records retention schedule.
Update to a new version
Deploy the new version's image tag. In a new terminal session, set the variables from step 1 first.
gcloud run services update civicshield-foia-service \
--region=$REGION \
--image=$IMAGE_REPO:NEW_TAG
Troubleshooting
- Deploy fails with a permission error on the image: your project doesn't have image access yet. Check step 2.
- A role grant says the service account doesn't exist: new service accounts can take a minute to become available. Wait and run the command again.
- The browser shows an access-denied page: that person needs to be added under Give staff access.
- The upload was refused because of scanned pages: the message lists the pages with no text layer. Run OCR on the file and upload it again.
- A large upload fails: uploads are limited to 32 MB. Split the packet and upload each part.
- Redaction fails with a permission error: check that the service account has the roles from step 5.
To see the service's recent logs:
gcloud logging read \
'resource.type="cloud_run_revision" AND resource.labels.service_name="civicshield-foia-service"' \
--limit=50
Remove CivicShield AI
Delete the service and its service account:
gcloud run services delete civicshield-foia-service --region=$REGION
gcloud iam service-accounts delete $SA
Keep or delete the audit dataset according to your agency's records retention schedule. To delete it and everything in it:
bq rm -r -d $PROJECT_ID:foia_compliance_audit
Need help?
See Support or email support@novfifteen.com. We never need access to your project: send error messages or log lines, with any personal information removed.