Virginia's statewide building code lets localities inspect existing buildings and require violations to be corrected. For an unsafe building, a code official can order repairs or demolition, authorize emergency repairs when there is imminent danger, and demolish a building if the owner ignores a demolition order. See Virginia Code § 36-105 and the Virginia Maintenance Code sections on inspections, notices and orders and unsafe structures.
Virginia also lets a locality adopt an ordinance requiring the owner to remove, repair, or secure a building that endangers public health or safety. Usually, the locality can do the work after at least 30 days' notice; serious hazards or emergencies can have shorter timelines. The cost is charged to the owner, and if unpaid it becomes a lien that ranks with unpaid local real estate taxes. See Virginia Code § 15.2-906.
When you sell to us, we're the buyer, so the repairs become our job.
An as-is agreement does not erase an existing order, lien, or local requirement, or stop a statutory deadline. Share the notice and any order so the buyer and title company can review what still needs to be addressed before closing.