claude-code icon indicating copy to clipboard operation
claude-code copied to clipboard

[BUG] Output blocked by content filtering policy

Open amarkulo opened this issue 10 months ago • 14 comments

Using Claude Code 1.0.24 I'm trying to implement GeolocationService in Laravel that would convert IP to location of the client that is accessing the service, but CC is not able to do the task.

Here are some outputs

✻ Thinking…

  Now I need to create the GeolocationService for IP to location conversion. This service should:

  1. Convert IP addresses to geographic locations (country, city)
  2. Handle both IPv4 and IPv6 addresses
  3. Use a local database or external API
  4. Cache results for performance
  5. Handle privacy considerations
  6. Provide fallback mechanisms

  For the geolocation service, I have a few options:
  1. Use a free service like ip-api.com or ipinfo.io
  2. Use a local database like GeoLite2
  3. Use a Laravel package

  I'll implement a service that can use multiple providers with fallbacks and caching.

Retry didn't helped either.

✻ Thinking…

  I'll create a GeolocationService that:

  1. Supports multiple providers (ip-api.com, ipinfo.io, etc.)
  2. Has caching for performance
  3. Includes rate limiting protection
  4. Handles both IPv4 and IPv6
  5. Provides fallback mechanisms
  6. Respects privacy settings
  7. Has local fallbacks for common ranges

  Let me implement this service.
  ⎿ API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"Output blocked by content filtering 
    policy"}}

> please continue with the GeolocationService
  ⎿ API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"Output blocked by content filtering 
    policy"}}

amarkulo avatar Jun 15 '25 12:06 amarkulo

I'm basically trying the same, just it should be list of countries. I think that because there is Russia, might be a problem ? Or any other problematic country.

I need to add comprehensive ISO 3166-1 alpha-2 country codes with full country names to the backend. Let me update the getFilterData function to include a complete
   country mapping:
  ⎿  API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"Output blocked by content filtering policy"}}
  ⎿  Interrupted by user

wildkemijoki avatar Aug 03 '25 22:08 wildkemijoki

Got same issue. I asked claude to write spam detector and had Russia keyword. How can you be loving so much Russia @claude?

moazam1 avatar Aug 04 '25 16:08 moazam1

just ran into this as well, trying to generate a country code to country name list...

klefix avatar Aug 04 '25 21:08 klefix

I ran in to this error with this prompt:

State should be a drop down of the 50 US states. Display the full name in proper noun case. The underlying value should be the state's two letter abbreviation. Sort the list by the full name a-z.

CdrMarks avatar Aug 09 '25 04:08 CdrMarks

Same issue, was trying to generate some random test data, with 2 digit ISO 3166-1 alpha-2 codes and associated full names.

aeris-alex avatar Aug 09 '25 10:08 aeris-alex

Same issue just asked for a US state form API error.

SaeedFarzanehzadeh avatar Aug 10 '25 05:08 SaeedFarzanehzadeh

Same issue just asked for a US state form API error.

the API is blocking the creation of the full US states list. Fixed: updating the form in chunks instead of full states at once.

SaeedFarzanehzadeh avatar Aug 10 '25 05:08 SaeedFarzanehzadeh

Also getting similar errors, trying to sort a 2 letter country code list alphabetically produced a content filtering issue

justinline avatar Aug 12 '25 09:08 justinline

Same here, I simply need to proceed a cities csv from GeoNames, into a json with the data I want. I thought it was the file too large for Claude so I spent a little while splitting it but still doesn't work, until I found this issue. The data is free for use and there's no copyright issue.

furic avatar Aug 19 '25 08:08 furic

I'm getting the same issues with Portuguese city names. That data is freely available and there's no copyright issue.

ricardofbarros avatar Aug 22 '25 16:08 ricardofbarros

This is getting ridiculous now. Mobile dev MCP taking screenshots of the app somehow is activating content policy filtering?

Image

amarkulo avatar Aug 23 '25 20:08 amarkulo

This issue has been inactive for 30 days. If the issue is still occurring, please comment to let us know. Otherwise, this issue will be automatically closed in 30 days for housekeeping purposes.

github-actions[bot] avatar Dec 04 '25 10:12 github-actions[bot]

I have a similar problem. I have, using Go, a country package with a map with all country names. Now I try to move that package to a shared repository and update all references/ add some other functions but Claude refuses with API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"Output blocked by content filtering policy"},"request_id":null}. Strange thing is, the list of countries was earlier generated by Claude itself.

I am using Claude Code version 2.0.76 (Claude Code)

package country

type Country struct {
	Code string `json:"code"`
	Name string `json:"name"`
}

// Exists checks if a country code is valid.
func Exists(code string) bool {
	for _, c := range ListCountries() {
		if c.Code == code {
			return true
		}
	}
	return false
}

func ListCountries() []Country {
	return []Country{
		{Code: "AF", Name: "Afghanistan"},
		{Code: "AX", Name: "Åland Islands"},
		{Code: "AL", Name: "Albania"},
		{Code: "DZ", Name: "Algeria"},
		{Code: "AS", Name: "American Samoa"},
		{Code: "AD", Name: "Andorra"},
		{Code: "AO", Name: "Angola"},
		{Code: "AI", Name: "Anguilla"},
		{Code: "AQ", Name: "Antarctica"},
		{Code: "AG", Name: "Antigua and Barbuda"},
		{Code: "AR", Name: "Argentina"},
		{Code: "AM", Name: "Armenia"},
		{Code: "AW", Name: "Aruba"},
		{Code: "AU", Name: "Australia"},
		{Code: "AT", Name: "Austria"},
		{Code: "AZ", Name: "Azerbaijan"},
		{Code: "BS", Name: "Bahamas"},
		{Code: "BH", Name: "Bahrain"},
		{Code: "BD", Name: "Bangladesh"},
		{Code: "BB", Name: "Barbados"},
		{Code: "BY", Name: "Belarus"},
		{Code: "BE", Name: "Belgium"},
		{Code: "BZ", Name: "Belize"},
		{Code: "BJ", Name: "Benin"},
		{Code: "BM", Name: "Bermuda"},
		{Code: "BT", Name: "Bhutan"},
		{Code: "BO", Name: "Bolivia (Plurinational State of)"},
		{Code: "BQ", Name: "Bonaire, Sint Eustatius and Saba"},
		{Code: "BA", Name: "Bosnia and Herzegovina"},
		{Code: "BW", Name: "Botswana"},
		{Code: "BV", Name: "Bouvet Island"},
		{Code: "BR", Name: "Brazil"},
		{Code: "IO", Name: "British Indian Ocean Territory"},
		{Code: "BN", Name: "Brunei Darussalam"},
		{Code: "BG", Name: "Bulgaria"},
		{Code: "BF", Name: "Burkina Faso"},
		{Code: "BI", Name: "Burundi"},
		{Code: "CV", Name: "Cabo Verde"},
		{Code: "KH", Name: "Cambodia"},
		{Code: "CM", Name: "Cameroon"},
		{Code: "CA", Name: "Canada"},
		{Code: "KY", Name: "Cayman Islands"},
		{Code: "CF", Name: "Central African Republic"},
		{Code: "TD", Name: "Chad"},
		{Code: "CL", Name: "Chile"},
		{Code: "CN", Name: "China"},
		{Code: "CX", Name: "Christmas Island"},
		{Code: "CC", Name: "Cocos (Keeling) Islands"},
		{Code: "CO", Name: "Colombia"},
		{Code: "KM", Name: "Comoros"},
		{Code: "CG", Name: "Congo"},
		{Code: "CD", Name: "Congo (Democratic Republic of the)"},
		{Code: "CK", Name: "Cook Islands"},
		{Code: "CR", Name: "Costa Rica"},
		{Code: "CI", Name: "Côte d'Ivoire"},
		{Code: "HR", Name: "Croatia"},
		{Code: "CU", Name: "Cuba"},
		{Code: "CW", Name: "Curaçao"},
		{Code: "CY", Name: "Cyprus"},
		{Code: "CZ", Name: "Czechia"},
		{Code: "DK", Name: "Denmark"},
		{Code: "DJ", Name: "Djibouti"},
		{Code: "DM", Name: "Dominica"},
		{Code: "DO", Name: "Dominican Republic"},
		{Code: "EC", Name: "Ecuador"},
		{Code: "EG", Name: "Egypt"},
		{Code: "SV", Name: "El Salvador"},
		{Code: "GQ", Name: "Equatorial Guinea"},
		{Code: "ER", Name: "Eritrea"},
		{Code: "EE", Name: "Estonia"},
		{Code: "SZ", Name: "Eswatini"},
		{Code: "ET", Name: "Ethiopia"},
		{Code: "FK", Name: "Falkland Islands (Malvinas)"},
		{Code: "FO", Name: "Faroe Islands"},
		{Code: "FJ", Name: "Fiji"},
		{Code: "FI", Name: "Finland"},
		{Code: "FR", Name: "France"},
		{Code: "GF", Name: "French Guiana"},
		{Code: "PF", Name: "French Polynesia"},
		{Code: "TF", Name: "French Southern Territories"},
		{Code: "GA", Name: "Gabon"},
		{Code: "GM", Name: "Gambia"},
		{Code: "GE", Name: "Georgia"},
		{Code: "DE", Name: "Germany"},
		{Code: "GH", Name: "Ghana"},
		{Code: "GI", Name: "Gibraltar"},
		{Code: "GR", Name: "Greece"},
		{Code: "GL", Name: "Greenland"},
		{Code: "GD", Name: "Grenada"},
		{Code: "GP", Name: "Guadeloupe"},
		{Code: "GU", Name: "Guam"},
		{Code: "GT", Name: "Guatemala"},
		{Code: "GG", Name: "Guernsey"},
		{Code: "GN", Name: "Guinea"},
		{Code: "GW", Name: "Guinea-Bissau"},
		{Code: "GY", Name: "Guyana"},
		{Code: "HT", Name: "Haiti"},
		{Code: "HM", Name: "Heard Island and McDonald Islands"},
		{Code: "VA", Name: "Holy See"},
		{Code: "HN", Name: "Honduras"},
		{Code: "HK", Name: "Hong Kong"},
		{Code: "HU", Name: "Hungary"},
		{Code: "IS", Name: "Iceland"},
		{Code: "IN", Name: "India"},
		{Code: "ID", Name: "Indonesia"},
		{Code: "IR", Name: "Iran (Islamic Republic of)"},
		{Code: "IQ", Name: "Iraq"},
		{Code: "IE", Name: "Ireland"},
		{Code: "IM", Name: "Isle of Man"},
		{Code: "IL", Name: "Israel"},
		{Code: "IT", Name: "Italy"},
		{Code: "JM", Name: "Jamaica"},
		{Code: "JP", Name: "Japan"},
		{Code: "JE", Name: "Jersey"},
		{Code: "JO", Name: "Jordan"},
		{Code: "KZ", Name: "Kazakhstan"},
		{Code: "KE", Name: "Kenya"},
		{Code: "KI", Name: "Kiribati"},
		{Code: "KP", Name: "Korea (Democratic People's Republic of)"},
		{Code: "KR", Name: "Korea (Republic of)"},
		{Code: "KW", Name: "Kuwait"},
		{Code: "KG", Name: "Kyrgyzstan"},
		{Code: "LA", Name: "Lao People's Democratic Republic"},
		{Code: "LV", Name: "Latvia"},
		{Code: "LB", Name: "Lebanon"},
		{Code: "LS", Name: "Lesotho"},
		{Code: "LR", Name: "Liberia"},
		{Code: "LY", Name: "Libya"},
		{Code: "LI", Name: "Liechtenstein"},
		{Code: "LT", Name: "Lithuania"},
		{Code: "LU", Name: "Luxembourg"},
		{Code: "MO", Name: "Macao"},
		{Code: "MG", Name: "Madagascar"},
		{Code: "MW", Name: "Malawi"},
		{Code: "MY", Name: "Malaysia"},
		{Code: "MV", Name: "Maldives"},
		{Code: "ML", Name: "Mali"},
		{Code: "MT", Name: "Malta"},
		{Code: "MH", Name: "Marshall Islands"},
		{Code: "MQ", Name: "Martinique"},
		{Code: "MR", Name: "Mauritania"},
		{Code: "MU", Name: "Mauritius"},
		{Code: "YT", Name: "Mayotte"},
		{Code: "MX", Name: "Mexico"},
		{Code: "FM", Name: "Micronesia (Federated States of)"},
		{Code: "MD", Name: "Moldova (Republic of)"},
		{Code: "MC", Name: "Monaco"},
		{Code: "MN", Name: "Mongolia"},
		{Code: "ME", Name: "Montenegro"},
		{Code: "MS", Name: "Montserrat"},
		{Code: "MA", Name: "Morocco"},
		{Code: "MZ", Name: "Mozambique"},
		{Code: "MM", Name: "Myanmar"},
		{Code: "NA", Name: "Namibia"},
		{Code: "NR", Name: "Nauru"},
		{Code: "NP", Name: "Nepal"},
		{Code: "NL", Name: "Netherlands"},
		{Code: "NC", Name: "New Caledonia"},
		{Code: "NZ", Name: "New Zealand"},
		{Code: "NI", Name: "Nicaragua"},
		{Code: "NE", Name: "Niger"},
		{Code: "NG", Name: "Nigeria"},
		{Code: "NU", Name: "Niue"},
		{Code: "NF", Name: "Norfolk Island"},
		{Code: "MK", Name: "North Macedonia"},
		{Code: "MP", Name: "Northern Mariana Islands"},
		{Code: "NO", Name: "Norway"},
		{Code: "OM", Name: "Oman"},
		{Code: "PK", Name: "Pakistan"},
		{Code: "PW", Name: "Palau"},
		{Code: "PS", Name: "Palestine, State of"},
		{Code: "PA", Name: "Panama"},
		{Code: "PG", Name: "Papua New Guinea"},
		{Code: "PY", Name: "Paraguay"},
		{Code: "PE", Name: "Peru"},
		{Code: "PH", Name: "Philippines"},
		{Code: "PN", Name: "Pitcairn"},
		{Code: "PL", Name: "Poland"},
		{Code: "PT", Name: "Portugal"},
		{Code: "PR", Name: "Puerto Rico"},
		{Code: "QA", Name: "Qatar"},
		{Code: "RE", Name: "Réunion"},
		{Code: "RO", Name: "Romania"},
		{Code: "RU", Name: "Russian Federation"},
		{Code: "RW", Name: "Rwanda"},
		{Code: "BL", Name: "Saint Barthélemy"},
		{Code: "SH", Name: "Saint Helena, Ascension and Tristan da Cunha"},
		{Code: "KN", Name: "Saint Kitts and Nevis"},
		{Code: "LC", Name: "Saint Lucia"},
		{Code: "MF", Name: "Saint Martin (French part)"},
		{Code: "PM", Name: "Saint Pierre and Miquelon"},
		{Code: "VC", Name: "Saint Vincent and the Grenadines"},
		{Code: "WS", Name: "Samoa"},
		{Code: "SM", Name: "San Marino"},
		{Code: "ST", Name: "Sao Tome and Principe"},
		{Code: "SA", Name: "Saudi Arabia"},
		{Code: "SN", Name: "Senegal"},
		{Code: "RS", Name: "Serbia"},
		{Code: "SC", Name: "Seychelles"},
		{Code: "SL", Name: "Sierra Leone"},
		{Code: "SG", Name: "Singapore"},
		{Code: "SX", Name: "Sint Maarten (Dutch part)"},
		{Code: "SK", Name: "Slovakia"},
		{Code: "SI", Name: "Slovenia"},
		{Code: "SB", Name: "Solomon Islands"},
		{Code: "SO", Name: "Somalia"},
		{Code: "ZA", Name: "South Africa"},
		{Code: "GS", Name: "South Georgia and the South Sandwich Islands"},
		{Code: "SS", Name: "South Sudan"},
		{Code: "ES", Name: "Spain"},
		{Code: "LK", Name: "Sri Lanka"},
		{Code: "SD", Name: "Sudan"},
		{Code: "SR", Name: "Suriname"},
		{Code: "SJ", Name: "Svalbard and Jan Mayen"},
		{Code: "SE", Name: "Sweden"},
		{Code: "CH", Name: "Switzerland"},
		{Code: "SY", Name: "Syrian Arab Republic"},
		{Code: "TW", Name: "Taiwan, Province of China"},
		{Code: "TJ", Name: "Tajikistan"},
		{Code: "TZ", Name: "Tanzania, United Republic of"},
		{Code: "TH", Name: "Thailand"},
		{Code: "TL", Name: "Timor-Leste"},
		{Code: "TG", Name: "Togo"},
		{Code: "TK", Name: "Tokelau"},
		{Code: "TO", Name: "Tonga"},
		{Code: "TT", Name: "Trinidad and Tobago"},
		{Code: "TN", Name: "Tunisia"},
		{Code: "TR", Name: "Türkiye"},
		{Code: "TM", Name: "Turkmenistan"},
		{Code: "TC", Name: "Turks and Caicos Islands"},
		{Code: "TV", Name: "Tuvalu"},
		{Code: "UG", Name: "Uganda"},
		{Code: "UA", Name: "Ukraine"},
		{Code: "AE", Name: "United Arab Emirates"},
		{Code: "GB", Name: "United Kingdom of Great Britain and Northern Ireland"},
		{Code: "US", Name: "United States of America"},
		{Code: "UM", Name: "United States Minor Outlying Islands"},
		{Code: "UY", Name: "Uruguay"},
		{Code: "UZ", Name: "Uzbekistan"},
		{Code: "VU", Name: "Vanuatu"},
		{Code: "VE", Name: "Venezuela (Bolivarian Republic of)"},
		{Code: "VN", Name: "Viet Nam"},
		{Code: "VG", Name: "Virgin Islands (British)"},
		{Code: "VI", Name: "Virgin Islands (U.S.)"},
		{Code: "WF", Name: "Wallis and Futuna"},
		{Code: "EH", Name: "Western Sahara"},
		{Code: "YE", Name: "Yemen"},
		{Code: "ZM", Name: "Zambia"},
		{Code: "ZW", Name: "Zimbabwe"},
	}
}

mbe81 avatar Dec 28 '25 01:12 mbe81